Lines Matching refs:test

4 void test(string comp = "==", A, B)(A a, B b, string msg, size_t line = __LINE__)
6 test(_d_assert_fail!(A)(comp, a, b), msg, line);
9 void test(const string actual, const string expected, size_t line = __LINE__)
22 test(1, 2, "1 != 2"); in testIntegers()
23 test(-10, 8, "-10 != 8"); in testIntegers()
24 test(byte.min, byte.max, "-128 != 127"); in testIntegers()
25 test(ubyte.min, ubyte.max, "0 != 255"); in testIntegers()
26 test(short.min, short.max, "-32768 != 32767"); in testIntegers()
27 test(ushort.min, ushort.max, "0 != 65535"); in testIntegers()
28 test(int.min, int.max, "-2147483648 != 2147483647"); in testIntegers()
29 test(uint.min, uint.max, "0 != 4294967295"); in testIntegers()
30 test(long.min, long.max, "-9223372036854775808 != 9223372036854775807"); in testIntegers()
31 test(ulong.min, ulong.max, "0 != 18446744073709551615"); in testIntegers()
32 test(shared(ulong).min, shared(ulong).max, "0 != 18446744073709551615"); in testIntegers()
35 test(testFun(), 2, "1 != 2"); in testIntegers()
40 test!"!="(2, 2, "2 == 2"); in testIntegerComparisons()
41 test!"<"(2, 1, "2 >= 1"); in testIntegerComparisons()
42 test!"<="(2, 1, "2 > 1"); in testIntegerComparisons()
43 test!">"(1, 2, "1 <= 2"); in testIntegerComparisons()
44 test!">="(1, 2, "1 < 2"); in testIntegerComparisons()
51 test(float.max, -float.max, "<float not supported> != <float not supported>"); in testFloatingPoint()
52 test(double.max, -double.max, "<double not supported> != <double not supported>"); in testFloatingPoint()
53 test(real(1), real(-1), "<real not supported> != <real not supported>"); in testFloatingPoint()
57 test(1.5, 2.5, "1.5 != 2.5"); in testFloatingPoint()
58 test(float.max, -float.max, "3.40282e+38 != -3.40282e+38"); in testFloatingPoint()
59 test(double.max, -double.max, "1.79769e+308 != -1.79769e+308"); in testFloatingPoint()
60 test(real(1), real(-1), "1 != -1"); in testFloatingPoint()
77 test(cast(S*) p, p, ptr ~ " != " ~ ptr); in testPointers()
82 test("foo", "bar", `"foo" != "bar"`); in testStrings()
83 test("", "bar", `"" != "bar"`); in testStrings()
87 test(dlang, rust, `"dlang" != "rust"`); in testStrings()
90 test("left"w, "right"w, `"left" != "right"`); in testStrings()
91 test("left"d, "right"d, `"left" != "right"`); in testStrings()
93 test('A', 'B', "'A' != 'B'"); in testStrings()
94 test(wchar('❤'), wchar('∑'), "'❤' != '∑'"); in testStrings()
95 test(dchar('❤'), dchar('∑'), "'❤' != '∑'"); in testStrings()
98 test(char(255), 'B', "cast(char) 255 != 'B'"); in testStrings()
99 test(wchar(0xD888), wchar('∑'), "cast(wchar) 55432 != '∑'"); in testStrings()
100 test(dchar(0xDDDD), dchar('∑'), "cast(dchar) 56797 != '∑'"); in testStrings()
116 test(new Foo("a"), new Foo("b"), "Foo(a) != Foo(b)"); in testToString()
120 test!"!="(f, f, "Foo(a) == Foo(a)"); in testToString()
136 test!"!="(Overloaded(), Overloaded(), "Const == Const"); in testToString()
139 test!"!is"(fnull, fnull, "`null` is `null`"); in testToString()
145 test([1], [0], "[1] != [0]"); in testArray()
146 test([1, 2, 3], [0], "[1, 2, 3] != [0]"); in testArray()
152test(arr, [0], "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,… in testArray()
163 test(a, S([3, 4]), "S([1, 2]) != S([3, 4])"); in testArray()
170 test(S(0), S(1), "S(0) != S(1)"); in testStruct()
171 test(T([T(null)]), T(null), "T([T([])]) != T([])"); in testStruct()
180 test(_d_assert_fail!(typeof(n))("!=", n, n), "NoCopy() == NoCopy()"); in testStruct()
183 test(_d_assert_fail!(typeof(sn))("!=", sn, sn), "NoCopy() == NoCopy()"); in testStruct()
188 test([1:"one"], [2: "two"], `[1: "one"] != [2: "two"]`); in testAA()
189 test!"in"(1, [2: 3], "1 !in [2: 3]"); in testAA()
190 test!"in"("foo", ["bar": true], `"foo" !in ["bar": true]`); in testAA()
206 test!"!is"([], null, (__ctfe ? "<void[] not supported>" : "[]") ~ " is `null`"); in testVoidArray()
207 test!"!is"(null, null, "`null` is `null`"); in testVoidArray()
208 test([1], null, "[1] != `null`"); in testVoidArray()
209 test("s", null, "\"s\" != `null`"); in testVoidArray()
210 test(['c'], null, "\"c\" != `null`"); in testVoidArray()
211 test!"!="(null, null, "`null` == `null`"); in testVoidArray()
214 test(chunk, null, (__ctfe ? "<void[] not supported>" : "[1, 2, 3]") ~ " != `null`"); in testVoidArray()
224 test!"!="(Bad(), Bad(), "Bad() == Bad()"); in testTemporary()
238 test(_d_assert_fail!(ubyte[])("==", ctfe.data, data), "[1] != []"); in testEnum()
243 test(_d_assert_fail!int("", 9), "9 != true");
244 test(_d_assert_fail!(int[])("!", [1, 2, 3]), "[1, 2, 3] == true");
249 test(_d_assert_fail("=="), "() != ()");
250 test(_d_assert_fail("!="), "() == ()");
251 test(_d_assert_fail(">="), "() < ()");
266 test!"!="(t1, t1, `T(false, 0, 2.5, 0, "bar", "") == T(false, 0, 2.5, 0, "bar", "")`);
268 test(t1, t2, `T(false, 0, 2.5, 0, "bar", "") != T(false, 0, 2.5, 0, "bari", "")`);
281 test!"!="(t1, t1, `T(false, 0, 2.5, 0) == T(false, 0, 2.5, 0)`);
283 test(t1, t2, `T(false, 0, 2.5, 0) != T(false, 2, 2.5, 0)`);
296 test!"!="(t1, t1, `T(false, 0, "bar", "") == T(false, 0, "bar", "")`);
298 test(t1, t2, `T(false, 0, "bar", "") != T(false, 0, "bari", "")`);
311 test!"!="(t1, t1, `T(2.5, 0, "bar", "") == T(2.5, 0, "bar", "")`);
313 test(t1, t2, `T(2.5, 0, "bar", "") != T(2.5, 0, "bari", "")`);
326 test!"!="(t1, t1, `T(false, 0, 0, "") == T(false, 0, 0, "")`);
328 test(t1, t2, `T(false, 0, 0, "") != T(true, 0, 0, "")`);
344 test!"!="(t1, t1, "T(false, 0, 0, \"\", [], `null`) == T(false, 0, 0, \"\", [], `null`)");
346 test(t1, t2, "T(false, 0, 0, \"\", [], `null`) != T(false, 0, 0, \"\", [1], `null`)");
348 test(t1, t3, "T(false, 0, 0, \"\", [], `null`) != T(false, 0, 0, \"\", [], C())");
364 test(t, t, `T(1, <context>: 0xabcd) != T(1, <context>: 0xabcd)`);
377 test(a, b, "Cpp(1) != Cpp(2)");
378 test(a, Cpp.init, "Cpp(1) != null");
389 test(a, b, "hello != world");
396 test(null_, notNull, "null != <Opaque>");
401 test(stuff, Stuff.init, "Stuff() != null");
414 test(s1, s2, "Small(1) != Small(2)");
423 test(b1, b2, "Big([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) != Big([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])");
456test(MayThrow(0), MayThrow(1), `Some message != <toString() failed: "Error", called on MayThrow(1)…
470test(S(1.0), S(2.0), "S(<overlapped field>, <overlapped field>) != S(<overlapped field>, <overlapp…
482test(S2(4, 1.0), S2(5, 2.0), "S2(4, <overlapped field>, <overlapped field>) != S2(5, <overlapped f…
502test(a, b, "S3(<overlapped field>, <overlapped field>, 8) != S3(<overlapped field>, <overlapped fi…