File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ 1
Original file line number Diff line number Diff line change
1
+ # String comparisons
2
+ STRING("1") NEWLINE
3
+ SET(x = "abc")
4
+ SET(y = "hello")
5
+ ASSERT(x < "b")
6
+ ASSERT(y >= "helln")
7
+ ASSERT(x != y)
Original file line number Diff line number Diff line change @@ -82,6 +82,22 @@ class Value {
82
82
else if constexpr (op == checktestdataParser::OR)
83
83
return Value{a || b};
84
84
}
85
+ if constexpr (std::is_same_v<T, string> &&
86
+ std::is_same_v<U, string>) {
87
+ if constexpr (op == checktestdataParser::EQ) {
88
+ return Value{a == b};
89
+ } else if constexpr (op == checktestdataParser::NE) {
90
+ return Value{a != b};
91
+ } else if constexpr (op == checktestdataParser::LE) {
92
+ return Value{a <= b};
93
+ } else if constexpr (op == checktestdataParser::LT) {
94
+ return Value{a < b};
95
+ } else if constexpr (op == checktestdataParser::GE) {
96
+ return Value{a >= b};
97
+ } else if constexpr (op == checktestdataParser::GT) {
98
+ return Value{a > b};
99
+ }
100
+ }
85
101
if constexpr (!is_numeric<T> || !is_numeric<U>) {
86
102
throw std::invalid_argument (" invalid operands" );
87
103
} else {
You can’t perform that action at this time.
0 commit comments