Skip to content

Commit

Permalink
test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 committed Jul 9, 2024
1 parent 73f0c20 commit fa8b73f
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions fail_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package chain_selectors

import (
"errors"
"os"
"sync"
"testing"
)

func TestFail(t *testing.T) {
if testing.Short() {
t.Skip()
}
t.Fatal("fake failure")
}

func TestRace(t *testing.T) {
var v int
var wg sync.WaitGroup
wg.Add(100)
for i := 0; i < 100; i++ {
go func() {
defer wg.Done()
v++
v--
}()
}
wg.Wait()
t.Log(v)
}

func TestLint(t *testing.T) {
const UnusedVar = 1 // lint should complain for unused variable
const ALL_CAPS = 10 // should be AllCaps
err := os.ErrNotExist
if err == os.ErrNotExist { // should use errors.Is
err := errors.New("fake error") // shadowed variable
t.Log(err)
}
}

0 comments on commit fa8b73f

Please sign in to comment.