-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
…ctory set
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package ccip | ||
|
||
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 v1 = (true && false) && (true && false) // SQ Identical expressions should not be used on both sides of a binary operator | ||
Check failure on line 33 in ccip/fail_test.go GitHub Actions / lint (ccip)
Check failure on line 33 in ccip/fail_test.go GitHub Actions / Flakeguard Root Project / Run Tests (github.com/smartcontractkit/chainlink/v2/ccip, ubuntu-latest)
Check failure on line 33 in ccip/fail_test.go GitHub Actions / Flakeguard Root Project / Run Tests (github.com/smartcontractkit/chainlink/v2/ccip, ubuntu-latest)
Check failure on line 33 in ccip/fail_test.go GitHub Actions / Core Tests (go_core_tests)
Check failure on line 33 in ccip/fail_test.go GitHub Actions / Core Tests (go_core_tests)
Check failure on line 33 in ccip/fail_test.go GitHub Actions / Core Tests (go_core_race_tests)
|
||
a := 1 | ||
if !(a == 2) { // SQ boolean check should not be inverted | ||
} | ||
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) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package core | ||
|
||
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 v1 = (true && false) && (true && false) // SQ Identical expressions should not be used on both sides of a binary operator | ||
Check failure on line 33 in core/fail_test.go GitHub Actions / Core Tests (go_core_tests)
Check failure on line 33 in core/fail_test.go GitHub Actions / Core Tests (go_core_tests)
Check failure on line 33 in core/fail_test.go GitHub Actions / Core Tests (go_core_race_tests)
Check failure on line 33 in core/fail_test.go GitHub Actions / Core Tests (go_core_race_tests)
Check failure on line 33 in core/fail_test.go GitHub Actions / Flakeguard Root Project / Run Tests (github.com/smartcontractkit/chainlink/v2/core, ubuntu-latest)
|
||
a := 1 | ||
if !(a == 2) { // SQ boolean check should not be inverted | ||
} | ||
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) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package deployment | ||
|
||
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 v1 = (true && false) && (true && false) // SQ Identical expressions should not be used on both sides of a binary operator | ||
a := 1 | ||
if !(a == 2) { // SQ boolean check should not be inverted | ||
} | ||
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) | ||
} | ||
} |