We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 73f0c20 commit 9c62194Copy full SHA for 9c62194
fail_test.go
@@ -0,0 +1,40 @@
1
+package chains
2
+
3
+import (
4
+ "errors"
5
+ "os"
6
+ "sync"
7
+ "testing"
8
+)
9
10
+func TestFail(t *testing.T) {
11
+ if testing.Short() {
12
+ t.Skip()
13
+ }
14
+ t.Fatal("fake failure")
15
+}
16
17
+func TestRace(t *testing.T) {
18
+ var v int
19
+ var wg sync.WaitGroup
20
+ wg.Add(100)
21
+ for i := 0; i < 100; i++ {
22
+ go func() {
23
+ defer wg.Done()
24
+ v++
25
+ v--
26
+ }()
27
28
+ wg.Wait()
29
+ t.Log(v)
30
31
32
+func TestLint(t *testing.T) {
33
+ const UnusedVar = 1 // lint should complain for unused variable
34
+ const ALL_CAPS = 10 // should be AllCaps
35
+ err := os.ErrNotExist
36
+ if err == os.ErrNotExist { // should use errors.Is
37
+ err := errors.New("fake error") // shadowed variable
38
+ t.Log(err)
39
40
0 commit comments