Skip to content

Commit

Permalink
Add (failing) globals unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
upamanyus committed Nov 25, 2024
1 parent f5d0be9 commit 311656f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions testdata/examples/unittest/globals.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package unittest

func foo() uint64 {
return 10
}

var globalX uint64 = foo()
var globalY string

func other() {
globalY = "ok"
}

func bar() {
other()
if x != 10 || globalY != "ok" {
panic("bad")
}
}

0 comments on commit 311656f

Please sign in to comment.