Skip to content

Commit

Permalink
added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
deelawn committed Dec 17, 2023
1 parent 87f4a7f commit 207764a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
12 changes: 12 additions & 0 deletions gnovm/tests/files/bool6.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main

func main() {
println(X())
}

func X() string {
return "hello" || "world"
}

// Error:
// main/files/bool6.gno:8: operands of boolean operators must evaluate to boolean typed values
16 changes: 16 additions & 0 deletions gnovm/tests/files/bool7.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package main

// Ensure, when comparing evaluated boolean operand types, that the kinds produced
// are the same when one operand is typed and the other is untyped.
func main() {
println(boolAndTrue(true))
println(boolAndTrue(false))
}

func boolAndTrue(b bool) bool {
return b && true
}

// Output:
// true
// false

0 comments on commit 207764a

Please sign in to comment.