github.com/Azareal/Gosora@v0.0.0-20210729070923-553e66b59003/experimental/counterTree/tree_test.go (about) 1 package main 2 3 import ( 4 "log" 5 "testing" 6 ) 7 8 func TestCounter(t *testing.T) { 9 counter := newTreeTopicViewCounter() 10 counter.Bump(1) 11 counter.Bump(57) 12 counter.Bump(58) 13 counter.Bump(59) 14 counter.Bump(9) 15 } 16 17 func TestScope(t *testing.T) { 18 var outVar int 19 closureHolder := func() { 20 outVar = 2 21 } 22 closureHolder() 23 log.Print("outVar: ", outVar) 24 }