From cf01ac1f05f1b339882e09ba6fc7748be3f78575 Mon Sep 17 00:00:00 2001 From: Richard Walters Date: Mon, 2 Dec 2019 20:37:23 -0800 Subject: Support first > last for range constructor of CharacterSet --- test/src/CharacterSetTests.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/src') diff --git a/test/src/CharacterSetTests.cpp b/test/src/CharacterSetTests.cpp index 7013127..3663ee6 100644 --- a/test/src/CharacterSetTests.cpp +++ b/test/src/CharacterSetTests.cpp @@ -43,6 +43,20 @@ TEST(CharacterSetTests, RangeConstructor) { } } +TEST(CharacterSetTests, Range_Constructor_Reversed) { + Uri::CharacterSet cs('G', 'A'); + for (char c = 0; c < 0x7F; ++c) { + if ( + (c >= 'A') + && (c <= 'G') + ) { + ASSERT_TRUE(cs.Contains(c)); + } else { + ASSERT_FALSE(cs.Contains(c)); + } + } +} + TEST(CharacterSetTests, InitializerListConstructor) { Uri::CharacterSet cs1{'X'}; for (char c = 0; c < 0x7F; ++c) { -- cgit v1.2.3