Changeset 641 for trunk/ab5.0
- Timestamp:
- Oct 9, 2008, 8:05:40 PM (16 years ago)
- Location:
- trunk/ab5.0/ablib/TestCase/SimpleTestCase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/ablib/TestCase/SimpleTestCase/SPrintFTest.ab
r468 r641 91 91 '現状では末尾の桁の誤差を制御しきれないので、文字列全体の一致比較を避けている。 92 92 s = FormatFloatF(12345678901234567e3, 2, 0, None) 93 UnitTest("FormatFloatF(1.00, precision = 2)", Right$(s, 6) ="000.00")93 UnitTest("FormatFloatF(1.00, precision = 2)", Right$(s, 6), "000.00") 94 94 95 95 s = FormatIntegerLO(&hFFFFFFFFFFFFFFFF, 0, 0, Alt) -
trunk/ab5.0/ablib/TestCase/SimpleTestCase/StringTest.ab
r512 r641 6 6 7 7 Sub TestMain() 8 8 9 Dim s1 = Nothing As String 9 10 10 11 11 s1 = New String("hello") 12 12 13 UnitTest("String.GetType", s1.GetType().Name ="String")13 UnitTest("String.GetType", s1.GetType().Name, "String") 14 14 15 15 16 16 UnitTest("String.String (case 0)", (memcmp(s1.StrPtr, "hello", SizeOf (Char) * 6) = 0)) 17 17 18 UnitTest("String.String (case 1)", (s1 = "hello"))18 UnitTest("String.String (case 1)", s1, "hello") 19 19 20 20 Dim nsz[2] = [&h31, &h32, &h33] As SByte 21 21 s1 = New String(nsz, 3) 22 UnitTest("String.String (case 2)", (s1 = "123"))22 UnitTest("String.String (case 2)", s1, "123") 23 23 24 24 Dim wsz[4] = [&h31, &h32, &h33, &h34, &h35] As WCHAR 25 25 s1 = New String(wsz, 5) 26 UnitTest("String.String (case 3)", (s1 = "12345"))26 UnitTest("String.String (case 3)", s1, "12345") 27 27 28 28 s1 = New String(&h30 As Char, 4) 29 UnitTest("String.String (case 4)", (s1 = "0000"))29 UnitTest("String.String (case 4)", s1, "0000") 30 30 31 31 s1 = "literal" 32 UnitTest("String.String (case 5)", (s1 = "literal"))32 UnitTest("String.String (case 5)", s1, "literal") 33 33 34 34 UnitTest("String.Length", (s1.Length = 7)) 35 35 36 UnitTest("String.ToString", (s1.ToString() = "literal"))37 UnitTest("String.Clone", (s1.Clone() = "literal"))36 UnitTest("String.ToString", s1.ToString(), "literal") 37 UnitTest("String.Clone", s1.Clone(), "literal") 38 38 39 39 UnitTest("String.Operator []", (s1[7] = 0)) … … 51 51 Dim o1 = New Object 52 52 Dim o2 = s1 As Object 53 UnitTest("String.Concat", (String.Concat(o1, o2) = "Objectabc"))53 UnitTest("String.Concat", String.Concat(o1, o2), "Objectabc") 54 54 55 UnitTest("String.Operator +", ( (s1 + "def") = "abcdef"))56 UnitTest("String.Operator &", ( (s1 + "xyz") = "abcxyz"))55 UnitTest("String.Operator +", (s1 + "def"), "abcdef") 56 UnitTest("String.Operator &", (s1 + "xyz"), "abcxyz") 57 57 58 58 s1 = "へのへの"
Note:
See TracChangeset
for help on using the changeset viewer.