Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions assert/assertion_compare_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
)

func TestCompare(t *testing.T) {
t.Parallel()

type customString string
type customInt int
type customInt8 int8
Expand Down Expand Up @@ -127,6 +129,8 @@ func callerName(skip int) string {
}

func TestGreater(t *testing.T) {
t.Parallel()

mockT := new(testing.T)

if !Greater(mockT, 2, 1) {
Expand Down Expand Up @@ -171,6 +175,8 @@ func TestGreater(t *testing.T) {
}

func TestGreaterOrEqual(t *testing.T) {
t.Parallel()

mockT := new(testing.T)

if !GreaterOrEqual(mockT, 2, 1) {
Expand Down Expand Up @@ -215,6 +221,8 @@ func TestGreaterOrEqual(t *testing.T) {
}

func TestLess(t *testing.T) {
t.Parallel()

mockT := new(testing.T)

if !Less(mockT, 1, 2) {
Expand Down Expand Up @@ -259,6 +267,8 @@ func TestLess(t *testing.T) {
}

func TestLessOrEqual(t *testing.T) {
t.Parallel()

mockT := new(testing.T)

if !LessOrEqual(mockT, 1, 2) {
Expand Down Expand Up @@ -303,6 +313,8 @@ func TestLessOrEqual(t *testing.T) {
}

func TestPositive(t *testing.T) {
t.Parallel()

mockT := new(testing.T)

if !Positive(mockT, 1) {
Expand Down Expand Up @@ -342,6 +354,8 @@ func TestPositive(t *testing.T) {
}

func TestNegative(t *testing.T) {
t.Parallel()

mockT := new(testing.T)

if !Negative(mockT, -1) {
Expand Down Expand Up @@ -381,6 +395,8 @@ func TestNegative(t *testing.T) {
}

func Test_compareTwoValuesDifferentValuesTypes(t *testing.T) {
t.Parallel()

mockT := new(testing.T)

for _, currCase := range []struct {
Expand All @@ -399,6 +415,8 @@ func Test_compareTwoValuesDifferentValuesTypes(t *testing.T) {
}

func Test_compareTwoValuesNotComparableValues(t *testing.T) {
t.Parallel()

mockT := new(testing.T)

type CompareStruct struct {
Expand All @@ -418,6 +436,8 @@ func Test_compareTwoValuesNotComparableValues(t *testing.T) {
}

func Test_compareTwoValuesCorrectCompareResult(t *testing.T) {
t.Parallel()

mockT := new(testing.T)

for _, currCase := range []struct {
Expand All @@ -438,6 +458,8 @@ func Test_compareTwoValuesCorrectCompareResult(t *testing.T) {
}

func Test_containsValue(t *testing.T) {
t.Parallel()

for _, currCase := range []struct {
values []compareResult
value compareResult
Expand Down
10 changes: 10 additions & 0 deletions assert/assertion_order_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
)

func TestIsIncreasing(t *testing.T) {
t.Parallel()

mockT := new(testing.T)

if !IsIncreasing(mockT, []int{1, 2}) {
Expand Down Expand Up @@ -51,6 +53,8 @@ func TestIsIncreasing(t *testing.T) {
}

func TestIsNonIncreasing(t *testing.T) {
t.Parallel()

mockT := new(testing.T)

if !IsNonIncreasing(mockT, []int{2, 1}) {
Expand Down Expand Up @@ -96,6 +100,8 @@ func TestIsNonIncreasing(t *testing.T) {
}

func TestIsDecreasing(t *testing.T) {
t.Parallel()

mockT := new(testing.T)

if !IsDecreasing(mockT, []int{2, 1}) {
Expand Down Expand Up @@ -141,6 +147,8 @@ func TestIsDecreasing(t *testing.T) {
}

func TestIsNonDecreasing(t *testing.T) {
t.Parallel()

mockT := new(testing.T)

if !IsNonDecreasing(mockT, []int{1, 2}) {
Expand Down Expand Up @@ -186,6 +194,8 @@ func TestIsNonDecreasing(t *testing.T) {
}

func TestOrderingMsgAndArgsForwarding(t *testing.T) {
t.Parallel()

msgAndArgs := []interface{}{"format %s %x", "this", 0xc001}
expectedOutput := "format this c001\n"
collection := []int{1, 2, 1}
Expand Down
Loading