UnitTestException on failure
1 auto arrayRangeWithoutLength(T)(T[] array) 2 { 3 struct ArrayRangeWithoutLength(T) 4 { 5 private: 6 T[] array; 7 public: 8 T front() const @property 9 { 10 return array[0]; 11 } 12 13 void popFront() 14 { 15 array = array[1 .. $]; 16 } 17 18 bool empty() const @property 19 { 20 return array.empty; 21 } 22 } 23 return ArrayRangeWithoutLength!T(array); 24 } 25 shouldNotBeIn(3.5, [1.1, 2.2, 4.4]); 26 shouldNotBeIn(1.0, [2.0 : 1, 3.0 : 2]); 27 shouldNotBeIn(1, arrayRangeWithoutLength([2, 3, 4])); 28 assertFail(1.shouldNotBeIn(arrayRangeWithoutLength([1, 2, 3]))); 29 assertFail("foo".shouldNotBeIn(["foo"]));
Verify that the value is not in the container.