Add in missing [] methods to some tests.
This commit is contained in:
parent
df9b43e27c
commit
8bb3a01e5c
2 changed files with 2 additions and 0 deletions
|
|
@ -42,6 +42,7 @@ class cat : map<int, bool> {
|
|||
}
|
||||
fn contains_key(&&k: int) -> bool { k <= self.meows }
|
||||
fn get(&&k:int) -> bool { k <= self.meows }
|
||||
fn [](&&k:int) -> bool { k <= self.meows }
|
||||
fn find(&&k:int) -> option<bool> { some(self.get(k)) }
|
||||
fn remove(&&k:int) -> option<bool> { self.meows -= k; some(true) }
|
||||
fn each(f: fn(&&int, &&bool) -> bool) {
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ class cat<T: copy> : map<int, T> {
|
|||
none { fail "epic fail"; }
|
||||
}
|
||||
}
|
||||
fn [](&&k:int) -> T { get(k) }
|
||||
fn find(&&k:int) -> option<T> { if k <= self.meows {
|
||||
some(self.name)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue