From 22c27854529b1e5c5da2b4845ffac764f208326d Mon Sep 17 00:00:00 2001 From: Krzysztof Wrzalik Date: Sun, 18 Sep 2016 17:44:45 +0200 Subject: [PATCH] Added tests for negative multi-span access. --- tests/multi_span_tests.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/multi_span_tests.cpp b/tests/multi_span_tests.cpp index f04ba84..69cb34b 100644 --- a/tests/multi_span_tests.cpp +++ b/tests/multi_span_tests.cpp @@ -1084,6 +1084,12 @@ SUITE(multi_span_tests) CHECK_THROW(av[10][2], fail_fast); CHECK_THROW((av[{10, 2}]), fail_fast); + + CHECK_THROW(av[-1][0], fail_fast); + CHECK_THROW((av[{-1, 0}]), fail_fast); + + CHECK_THROW(av[0][-1], fail_fast); + CHECK_THROW((av[{0, -1}]), fail_fast); } void overloaded_func(multi_span exp, int expected_value)