Skip to content

Commit e24c2f4

Browse files
Disable bogus tests if char is unsigned
The limits of char are architecture dependent, and all modern architectures make it unsigned. Fixes issue 253.
1 parent 029f1f1 commit e24c2f4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/generating.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <climits>
12
#include <ctre.hpp>
23

34
void empty_symbol() { }
@@ -52,10 +53,12 @@ static_assert(same_f(CTRE_GEN("(?:abc)"), ctre::string<'a','b','c'>()));
5253
// support for hexdec
5354
static_assert(same_f(CTRE_GEN("\\x40"), ctre::character<char{0x40}>()));
5455
static_assert(same_f(CTRE_GEN("\\x7F"), ctre::character<char{0x7F}>()));
56+
#if CHAR_MAX < 128
5557
// only characters with value < 128 are char otherwise they are internally char32_t
5658
static_assert(same_f(CTRE_GEN("\\x80"), ctre::character<char32_t{0x80}>()));
5759
static_assert(same_f(CTRE_GEN("\\xFF"), ctre::character<char32_t{0xFF}>()));
5860
static_assert(same_f(CTRE_GEN("\\x{FF}"), ctre::character<char32_t{0xFF}>()));
61+
#endif
5962
static_assert(same_f(CTRE_GEN("\\x{FFF}"), ctre::character<char32_t{0xFFF}>()));
6063
static_assert(same_f(CTRE_GEN("\\x{ABCD}"), ctre::character<char32_t{0xABCD}>()));
6164

0 commit comments

Comments
 (0)