'--------------------------------------------------------------------
' Test case of SPrintF Function and etc...
'--------------------------------------------------------------------

Imports ActiveBasic.Strings
Imports ActiveBasic.Strings.Detail

Namespace SPrintFTest

Sub TestMain()
	Dim s = Nothing As String, e As Long, sign As Boolean

	s = FloatToChars(1., e, sign)
	UnitTest("FloatToChars(1)", s = "10000000000000000" And e = 0 And sign = False)

	s = FloatToChars(-93.75e-3, e, sign)
	UnitTest("FloatToChars(-93.75e-3)", s = "93750000000000000" And e = 1 - 3 And sign = True)

	s = FloatToChars(.0, e, sign)
	UnitTest("FloatToChars(0)", s = "00000000000000000" And e = 0 And sign = False)

	s = FormatFloatE(9.876543e021, 6, 0, None)
	UnitTest("FormatFloatE(9876543e021)", s = "9.876543e021")

	s = FormatFloatE(7.81250000E-003, 8, 0, Cap)
	UnitTest("FormatFloatE(7.81250000E-003)", s = "7.81250000E-003")
	/*
	上は、現在s = 7.81250000E-03となり失敗する。
	FormatIntegerDを作成していないことが要因。
	*/

	s = FormatIntegerU(777, 0, 0, None)
	UnitTest("FormatIntegerU(777)", s = "777")

	s = FormatIntegerU(513, 0, 5, None)
	UnitTest("FormatIntegerU(513, Field size = 5)", s = "  513")

End Sub

End Namespace 'SPrintFTest

SPrintFTest.TestMain()
