1 module tests.fail.normal; 2 3 4 import unit_threaded; 5 6 7 @("wrong.0") 8 unittest { 9 shouldBeTrue(5 == 3); 10 shouldBeFalse(5 == 5); 11 5.shouldEqual(5); 12 5.shouldNotEqual(3); 13 5.shouldEqual(3); 14 } 15 16 17 @("wrong.1") 18 unittest { 19 shouldBeTrue(false); 20 } 21 22 23 @("right") 24 unittest { 25 shouldBeTrue(true); 26 } 27 28 @("true") 29 unittest { 30 shouldBeTrue(true); 31 } 32 33 @("equalVars") 34 unittest { 35 immutable foo = 4; 36 immutable bar = 6; 37 foo.shouldEqual(bar); 38 } 39 40 void someFun() { 41 //not going to be executed as part of the testsuite 42 assert(0, "Never going to happen"); 43 } 44 45 @("stringEqual") 46 unittest { 47 "foo".shouldEqual("bar"); 48 } 49 50 @("stringEqualFails") 51 unittest { 52 "foo".shouldEqual("bar"); 53 } 54 55 @("stringNotEqual") 56 unittest { 57 "foo".shouldNotEqual("foo"); 58 } 59 60 unittest { 61 const str = "unittest block that always fails"; 62 writelnUt(str); 63 assert(3 == 4, str); 64 } 65 66 @("intArray") 67 unittest { 68 [1, 2, 4].shouldEqual([1, 2, 3]); 69 } 70 71 @("stringArray") 72 unittest { 73 ["foo", "baz", "badoooooooooooo!"].shouldEqual(["foo", "bar", "baz"]); 74 }