From 9c05779fac9325ec4734aabb996560b448a78331 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Wed, 27 Aug 2014 12:15:47 -0600 Subject: [PATCH] Add failing range test Crash occurs if the user attempts to use a range and the source of the range has gone out of scope. #132 --- unittests/range.chai | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/unittests/range.chai b/unittests/range.chai index 97a430b1..db4a1a9f 100644 --- a/unittests/range.chai +++ b/unittests/range.chai @@ -2,3 +2,9 @@ auto x = [1, 2, 3, 4] auto r = range(x) r.pop_front() assert_equal(2, r.front()); + +// test with temporary vector for range +auto q = range([1, 2, 3, 4]) +q.pop_front() +assert_equal(2, q.front()); +