Skip to content

Commit

Permalink
fix typos in comments and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ccoVeille committed Aug 9, 2022
1 parent 181cea6 commit 0110c1e
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion assert/assertion_format.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func EqualErrorf(t TestingT, theError error, errString string, msg string, args
return EqualError(t, theError, errString, append([]interface{}{msg}, args...)...)
}

// EqualValuesf asserts that two objects are equal or convertable to the same types
// EqualValuesf asserts that two objects are equal or convertible to the same types
// and equal.
//
// assert.EqualValuesf(t, uint32(123), int32(123), "error message %s", "formatted")
Expand Down
4 changes: 2 additions & 2 deletions assert/assertion_forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (a *Assertions) EqualErrorf(theError error, errString string, msg string, a
return EqualErrorf(a.t, theError, errString, msg, args...)
}

// EqualValues asserts that two objects are equal or convertable to the same types
// EqualValues asserts that two objects are equal or convertible to the same types
// and equal.
//
// a.EqualValues(uint32(123), int32(123))
Expand All @@ -166,7 +166,7 @@ func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAn
return EqualValues(a.t, expected, actual, msgAndArgs...)
}

// EqualValuesf asserts that two objects are equal or convertable to the same types
// EqualValuesf asserts that two objects are equal or convertible to the same types
// and equal.
//
// a.EqualValuesf(uint32(123), int32(123), "error message %s", "formatted")
Expand Down
4 changes: 2 additions & 2 deletions assert/assertions.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func messageFromMsgAndArgs(msgAndArgs ...interface{}) string {

// Aligns the provided message so that all lines after the first line start at the same location as the first line.
// Assumes that the first line starts at the correct location (after carriage return, tab, label, spacer and tab).
// The longestLabelLen parameter specifies the length of the longest label in the output (required becaues this is the
// The longestLabelLen parameter specifies the length of the longest label in the output (required because this is the
// basis on which the alignment occurs).
func indentMessageLines(message string, longestLabelLen int) string {
outBuf := new(bytes.Buffer)
Expand Down Expand Up @@ -454,7 +454,7 @@ func truncatingFormat(data interface{}) string {
return value
}

// EqualValues asserts that two objects are equal or convertable to the same types
// EqualValues asserts that two objects are equal or convertible to the same types
// and equal.
//
// assert.EqualValues(t, uint32(123), int32(123))
Expand Down
4 changes: 2 additions & 2 deletions assert/assertions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ func TestNotEqualValues(t *testing.T) {
{new(AssertionTesterConformingObject), new(AssertionTesterConformingObject), false},
{&struct{}{}, &struct{}{}, false},

// Different behaviour from NotEqual()
// Different behavior from NotEqual()
{func() int { return 23 }, func() int { return 24 }, true},
{int(10), int(11), true},
{int(10), uint(10), false},
Expand Down Expand Up @@ -1575,7 +1575,7 @@ func TestInEpsilonSlice(t *testing.T) {
True(t, InEpsilonSlice(mockT,
[]float64{2.2, math.NaN(), 2.0},
[]float64{2.1, math.NaN(), 2.1},
0.06), "{2.2, NaN, 2.0} is element-wise close to {2.1, NaN, 2.1} in espilon=0.06")
0.06), "{2.2, NaN, 2.0} is element-wise close to {2.1, NaN, 2.1} in epsilon=0.06")

False(t, InEpsilonSlice(mockT,
[]float64{2.2, 2.0},
Expand Down
2 changes: 1 addition & 1 deletion mock/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (c *Call) Return(returnArguments ...interface{}) *Call {
return c
}

// Panic specifies if the functon call should fail and the panic message
// Panic specifies if the function call should fail and the panic message
//
// Mock.On("DoSomething").Panic("test panic")
func (c *Call) Panic(msg string) *Call {
Expand Down
2 changes: 1 addition & 1 deletion mock/mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1831,7 +1831,7 @@ func TestAfterTotalWaitTimeWhileExecution(t *testing.T) {

end := time.Now()
elapsedTime := end.Sub(start)
assert.True(t, elapsedTime > waitMs, fmt.Sprintf("Total elapsed time:%v should be atleast greater than %v", elapsedTime, waitMs))
assert.True(t, elapsedTime > waitMs, fmt.Sprintf("Total elapsed time:%v should be at least greater than %v", elapsedTime, waitMs))
assert.Equal(t, total, len(results))
for i := range results {
assert.Equal(t, fmt.Sprintf("Time%d", i), results[i], "Return value of method should be same")
Expand Down
4 changes: 2 additions & 2 deletions require/require.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func EqualErrorf(t TestingT, theError error, errString string, msg string, args
t.FailNow()
}

// EqualValues asserts that two objects are equal or convertable to the same types
// EqualValues asserts that two objects are equal or convertible to the same types
// and equal.
//
// assert.EqualValues(t, uint32(123), int32(123))
Expand All @@ -209,7 +209,7 @@ func EqualValues(t TestingT, expected interface{}, actual interface{}, msgAndArg
t.FailNow()
}

// EqualValuesf asserts that two objects are equal or convertable to the same types
// EqualValuesf asserts that two objects are equal or convertible to the same types
// and equal.
//
// assert.EqualValuesf(t, uint32(123), int32(123), "error message %s", "formatted")
Expand Down
4 changes: 2 additions & 2 deletions require/require_forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (a *Assertions) EqualErrorf(theError error, errString string, msg string, a
EqualErrorf(a.t, theError, errString, msg, args...)
}

// EqualValues asserts that two objects are equal or convertable to the same types
// EqualValues asserts that two objects are equal or convertible to the same types
// and equal.
//
// a.EqualValues(uint32(123), int32(123))
Expand All @@ -167,7 +167,7 @@ func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAn
EqualValues(a.t, expected, actual, msgAndArgs...)
}

// EqualValuesf asserts that two objects are equal or convertable to the same types
// EqualValuesf asserts that two objects are equal or convertible to the same types
// and equal.
//
// a.EqualValuesf(uint32(123), int32(123), "error message %s", "formatted")
Expand Down
2 changes: 1 addition & 1 deletion suite/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
type SuiteRequireTwice struct{ Suite }

// TestSuiteRequireTwice checks for regressions of issue #149 where
// suite.requirements was not initialised in suite.SetT()
// suite.requirements was not initialized in suite.SetT()
// A regression would result on these tests panicking rather than failing.
func TestSuiteRequireTwice(t *testing.T) {
ok := testing.RunTests(
Expand Down

0 comments on commit 0110c1e

Please sign in to comment.