Fixed test

This commit is contained in:
2026-06-05 12:56:14 +02:00
parent 595ddc789d
commit b311dbd16c
12 changed files with 72 additions and 77 deletions
+4 -4
View File
@@ -8,12 +8,12 @@ struct Dog {
impl Speak for Dog {
String speak(self*) {
"woof"
"woof".to_string()
}
}
pub void test_trait_impl() {
let d = Dog { name: "Rex" };
let d = Dog { name: "Rex".to_string() };
assert_eq!(d.speak(), "woof");
}
@@ -23,12 +23,12 @@ trait Greet : Speak {
impl Greet for Dog {
String greet(self*) {
"hello"
"hello".to_string()
}
}
pub void test_trait_with_requirement() {
let d = Dog { name: "Buddy" };
let d = Dog { name: "Buddy".to_string() };
assert_eq!(d.speak(), "woof");
assert_eq!(d.greet(), "hello");
}