try? / catch?

This commit is contained in:
Christoffer Lerno
2023-03-17 00:45:23 +01:00
committed by Christoffer Lerno
parent 1b667cbc93
commit 8b0df0ee11
33 changed files with 235 additions and 183 deletions

View File

@@ -80,7 +80,7 @@ fn void! test_index_of()
String test = "hello world hello";
assert(test.index_of("o")? == 4);
assert(test.index_of("ll")? == 2);
assert(catch(test.index_of("wi")));
assert(catch? test.index_of("wi"));
}
fn void! test_rindex_of()
@@ -90,5 +90,5 @@ fn void! test_rindex_of()
assert(test.rindex_of("ll")? == 14);
assert(test.rindex_of("he")? == 12);
assert(test.rindex_of("world")? == 6);
assert(catch(test.rindex_of("wi")));
assert(catch? test.rindex_of("wi"));
}