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
+7 -7
View File
@@ -1,7 +1,7 @@
pub class Counter {
pub Int count;
pub i32 count;
pub constructor(Int start) {
pub constructor(i32 start) {
self.count = start;
}
@@ -9,7 +9,7 @@ pub class Counter {
self.count++;
}
pub Int get(self*) -> Int {
pub i32 get(self*) {
self.count
}
}
@@ -33,17 +33,17 @@ pub void test_class_field_access() {
class NamedCounter : Counter {
pub String name;
pub constructor(Int start, String name) {
pub constructor(i32 start, String name) {
self.name = name;
}
pub String get_name(self*) -> String {
self.name
pub String get_name(self*) {
self.name.clone()
}
}
pub void test_class_inherit() {
let nc = NamedCounter::new(10, "test");
let nc = NamedCounter::new(10, "test".to_string());
assert_eq!(nc.get_name(), "test");
assert_eq!(nc.count, 10);
}