From 8f87b3a7d3d8604c8ffd0f75bc8b9a6a015c0d0c Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Wed, 3 Jul 2024 12:10:46 -0500 Subject: [PATCH] test ci --- fail_test.go | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 fail_test.go diff --git a/fail_test.go b/fail_test.go new file mode 100644 index 00000000..c26b1d35 --- /dev/null +++ b/fail_test.go @@ -0,0 +1,40 @@ +package chainlink_cosmos + +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) + } +}