Skip to content

Commit

Permalink
Add postfix operator tests
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniusnaumann committed Feb 16, 2024
1 parent dbf2826 commit 12e4be7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions galvan-test/src/postfix.galvan
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
test "Use '!' operator on optional" {
let bailed = func_with_result()
assert bailed.unwrap_err() == 1
}

fn func_with_result() -> Int!USize {
let vec = ["H", "Z"]
let bail = vec.binary_search("Hi")!

if true { 27 }.ok_or(27)
}

0 comments on commit 12e4be7

Please sign in to comment.