-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_complex_static.jai
More file actions
28 lines (24 loc) · 966 Bytes
/
Copy pathtest_complex_static.jai
File metadata and controls
28 lines (24 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class Config {
static array<string> VALID_OPTIONS = ["option1", "option2", "option3"];
function isValidOption(string opt) -> bool {
print("Checking option: " + opt);
print("VALID_OPTIONS.size() = " + to_string(VALID_OPTIONS.size()));
for (auto i = 0; i < VALID_OPTIONS.size(); i = i + 1) {
print(" i=" + to_string(i) + ", VALID_OPTIONS[i]=" + VALID_OPTIONS[i]);
if (VALID_OPTIONS[i] == opt) {
print(" Found match!");
return true;
}
}
print(" No match found");
return false;
}
}
print("Testing static array access...");
print("Config::VALID_OPTIONS.size() = " + to_string(Config::VALID_OPTIONS.size()));
print("Config::VALID_OPTIONS[0] = " + Config::VALID_OPTIONS[0]);
print("\nCreating instance and calling method...");
auto cfg = Config();
auto result = cfg.isValidOption("option2");
print("Result: " + to_string(result));
result