summaryrefslogtreecommitdiff
path: root/tests/collections
diff options
context:
space:
mode:
authorZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-19 22:48:04 +0000
committerZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-19 22:48:04 +0000
commit23065ddf6ed0b3762dda5f5059888eb52b5c2415 (patch)
treeaec187b8211203081e8dacb07a5ce325eb348cc4 /tests/collections
parent3af5dcf34d705cc52c1ffe5b85c2a90b5104e4c9 (diff)
Fixes related to memory safety. I will work more on this related to the stdlib.
Diffstat (limited to 'tests/collections')
-rw-r--r--tests/collections/test_string_suite.zc12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/collections/test_string_suite.zc b/tests/collections/test_string_suite.zc
index 4d2c080..a3f608d 100644
--- a/tests/collections/test_string_suite.zc
+++ b/tests/collections/test_string_suite.zc
@@ -10,7 +10,7 @@ test "test_string_methods" {
var s1: String = String::from("Hello World");
var sub: String = s1.substring(0, 5);
var expected1: String = String::from("Hello");
- if (sub.eq(expected1)) {
+ if (sub.eq(&expected1)) {
println " -> substring(0, 5): Passed";
} else {
assert(false, "substring(0, 5) failed");
@@ -19,7 +19,7 @@ test "test_string_methods" {
// Substring middle
var sub2: String = s1.substring(6, 5);
var expected2: String = String::from("World");
- if (sub2.eq(expected2)) {
+ if (sub2.eq(&expected2)) {
println " -> substring(6, 5): Passed";
} else {
assert(false, "substring(6, 5) failed");
@@ -67,9 +67,9 @@ test "test_string_methods" {
// Append
var s2: String = String::from("Hello");
var s3: String = String::from(" World");
- s2.append(s3);
+ s2.append(&s3);
var expected6: String = String::from("Hello World");
- if (s2.eq(expected6)) {
+ if (s2.eq(&expected6)) {
println " -> append(): Passed";
} else {
assert(false, "append() failed");
@@ -99,7 +99,7 @@ test "test_string_std_ops" {
var s1 = String::from("Hello");
var s2 = String::from(" World");
- var s3 = s1 + s2;
+ var s3 = s1.add(&s2);
print "Concatenated: ";
s3.println();
@@ -107,7 +107,7 @@ test "test_string_std_ops" {
assert(s3.length() == 11, "Length mismatch");
var s4 = String::from("Hello World");
- if (s3.eq(s4)) {
+ if (s3.eq(&s4)) {
println "Equality check passed: Strings are identical.";
} else {
assert(false, "Equality check failed");