summaryrefslogtreecommitdiff
path: root/tests/std/test_string_utils.zc
diff options
context:
space:
mode:
authorSAJJA EASWAR <eshwarsajja20@gmail.com>2026-01-25 22:59:36 +0530
committerSAJJA EASWAR <eshwarsajja20@gmail.com>2026-01-25 22:59:36 +0530
commitebc8b94baa6bc694cb4829e2eb2934a1f17fa6a1 (patch)
tree71b952ad455bf17d5bdea01472f0e2297f25eabe /tests/std/test_string_utils.zc
parent863118c95caac0d69a35f6ae4d2e83844734a8a1 (diff)
parent489336b2101bf16edeec7bfc4379408eb19b936e (diff)
Merge branch 'main' into pr-109
Diffstat (limited to 'tests/std/test_string_utils.zc')
-rw-r--r--tests/std/test_string_utils.zc40
1 files changed, 20 insertions, 20 deletions
diff --git a/tests/std/test_string_utils.zc b/tests/std/test_string_utils.zc
index 212bac1..c001ef4 100644
--- a/tests/std/test_string_utils.zc
+++ b/tests/std/test_string_utils.zc
@@ -1,46 +1,46 @@
import "std/string.zc"
test "string trim" {
- var s1 = String::from(" hello ");
- var t1 = s1.trim();
- var e1 = String::from("hello");
+ let s1 = String::from(" hello ");
+ let t1 = s1.trim();
+ let e1 = String::from("hello");
assert(t1.eq(&e1));
t1.free(); s1.free(); e1.free();
- var s2 = String::from("\n\t world \r ");
- var t2 = s2.trim();
- var e2 = String::from("world");
+ let s2 = String::from("\n\t world \r ");
+ let t2 = s2.trim();
+ let e2 = String::from("world");
assert(t2.eq(&e2));
t2.free(); s2.free(); e2.free();
- var s3 = String::from("no_trim");
- var t3 = s3.trim();
- var e3 = String::from("no_trim");
+ let s3 = String::from("no_trim");
+ let t3 = s3.trim();
+ let e3 = String::from("no_trim");
assert(t3.eq(&e3));
t3.free(); s3.free(); e3.free();
- var s4 = String::from(" ");
- var t4 = s4.trim();
+ let s4 = String::from(" ");
+ let t4 = s4.trim();
assert(t4.is_empty());
t4.free(); s4.free();
}
test "string replace" {
- var s1 = String::from("foo bar foo");
- var r1 = s1.replace("foo", "baz");
- var e1 = String::from("baz bar baz");
+ let s1 = String::from("foo bar foo");
+ let r1 = s1.replace("foo", "baz");
+ let e1 = String::from("baz bar baz");
assert(r1.eq(&e1));
r1.free(); s1.free(); e1.free();
- var s2 = String::from("hello world");
- var r2 = s2.replace("world", "ZenC");
- var e2 = String::from("hello ZenC");
+ let s2 = String::from("hello world");
+ let r2 = s2.replace("world", "ZenC");
+ let e2 = String::from("hello ZenC");
assert(r2.eq(&e2));
r2.free(); s2.free(); e2.free();
- var s3 = String::from("aaaa");
- var r3 = s3.replace("aa", "b");
- var e3 = String::from("bb");
+ let s3 = String::from("aaaa");
+ let r3 = s3.replace("aa", "b");
+ let e3 = String::from("bb");
assert(r3.eq(&e3));
r3.free(); s3.free(); e3.free();
}