summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2022-02-04 10:32:20 +0200
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2022-02-04 11:35:01 +0200
commit244db375087440888ca5b86fd0d114a54f41489a (patch)
tree1297f0ceeb3a41e918cfcce11bdc441f72c049a3 /tests
parent2a3c4f00c892dbee388cda69239285df3e0a41b5 (diff)
Cleanup and move char functions to the `char_utils.h` header.
Diffstat (limited to 'tests')
-rw-r--r--tests/core/math/test_math.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/core/math/test_math.cpp b/tests/core/math/test_math.cpp
index a24a8fde2b..4182455b7a 100644
--- a/tests/core/math/test_math.cpp
+++ b/tests/core/math/test_math.cpp
@@ -227,7 +227,7 @@ class GetClassAndNamespace {
return TK_SYMBOL;
}
- if (code[idx] == '-' || (code[idx] >= '0' && code[idx] <= '9')) {
+ if (code[idx] == '-' || is_digit(code[idx])) {
//a number
const char32_t *rptr;
double number = String::to_float(&code[idx], &rptr);
@@ -235,10 +235,10 @@ class GetClassAndNamespace {
value = number;
return TK_NUMBER;
- } else if ((code[idx] >= 'A' && code[idx] <= 'Z') || (code[idx] >= 'a' && code[idx] <= 'z') || code[idx] > 127) {
+ } else if (is_ascii_char(code[idx]) || code[idx] > 127) {
String id;
- while ((code[idx] >= 'A' && code[idx] <= 'Z') || (code[idx] >= 'a' && code[idx] <= 'z') || code[idx] > 127) {
+ while (is_ascii_char(code[idx]) || code[idx] > 127) {
id += code[idx];
idx++;
}