From f1d3056dd8111f778c312f8a0bcde71ffe6838c1 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 4 Aug 2025 17:41:56 +0300 Subject: [PATCH] chore: correct spelling in comments and test names --- json_fuzz_test.go | 8 ++++---- json_test.go | 6 +++--- orderedmap_test.go | 8 ++++---- yaml_fuzz_test.go | 4 ++-- yaml_test.go | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/json_fuzz_test.go b/json_fuzz_test.go index 8d905ad..4ed2f7c 100644 --- a/json_fuzz_test.go +++ b/json_fuzz_test.go @@ -64,10 +64,10 @@ func FuzzRoundTripJSON(f *testing.F) { require.NoError(t, json.Unmarshal(mapJsonData, &m2)) t.Logf("initial data = %s", string(data)) - t.Logf("unmarshalled map = %v", m1) - t.Logf("re-marshalled from map = %s", string(mapJsonData)) - t.Logf("re-marshalled from test obj = %s", string(jsonData)) - t.Logf("re-unmarshalled map = %s", m2) + t.Logf("unmarshaled map = %v", m1) + t.Logf("re-marshaled from map = %s", string(mapJsonData)) + t.Logf("re-marshaled from test obj = %s", string(jsonData)) + t.Logf("re-unmarshaled map = %s", m2) } }) } diff --git a/json_test.go b/json_test.go index bfb08b7..aa8e22a 100644 --- a/json_test.go +++ b/json_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/require" ) -// to test marshalling TextMarshalers and unmarshalling TextUnmarshalers +// to test marshalling TextMarshalers and unmarshaling TextUnmarshalers type marshallable int func (m marshallable) MarshalText() ([]byte, error) { @@ -129,7 +129,7 @@ func TestMarshalJSON(t *testing.T) { }) } -func TestUnmarshallJSON(t *testing.T) { +func TestUnmarshalJSON(t *testing.T) { t.Run("int key", func(t *testing.T) { data := `{"1":"bar","7":"baz","2":28,"3":100,"4":"baz","5":"28","6":"100","8":"baz"}` @@ -229,7 +229,7 @@ func TestJSONSpecialCharacters(t *testing.T) { require.Equal(t, baselineData, b) }) - t.Run("unmarshall special characters", func(t *testing.T) { + t.Run("unmarshal special characters", func(t *testing.T) { om := New[string, any]() require.NoError(t, json.Unmarshal(baselineData, &om)) assertOrderedPairsEqual(t, om, diff --git a/orderedmap_test.go b/orderedmap_test.go index 2dd64bd..fda11b6 100644 --- a/orderedmap_test.go +++ b/orderedmap_test.go @@ -336,7 +336,7 @@ func TestNewWithCapacity(t *testing.T) { } func TestNewWithOptions(t *testing.T) { - t.Run("wih capacity", func(t *testing.T) { + t.Run("with capacity", func(t *testing.T) { om := New[string, any](WithCapacity[string, any](98)) assert.Equal(t, 0, om.Len()) }) @@ -499,16 +499,16 @@ func TestIteratorsFrom(t *testing.T) { func TestFilter(t *testing.T) { om := New[int, int]() - + n := 10 * 3 // ensure divisibility by 3 for the length check below for i := range n { om.Set(i, i*i) } - + om.Filter(func(k, v int) bool { return k % 3 == 0 }) - + assert.Equal(t, n / 3, om.Len()) for k := range om.FromOldest() { assert.True(t, k%3==0) diff --git a/yaml_fuzz_test.go b/yaml_fuzz_test.go index 6bbe43c..084c173 100644 --- a/yaml_fuzz_test.go +++ b/yaml_fuzz_test.go @@ -70,10 +70,10 @@ func FuzzRoundTripYAML(f *testing.F) { require.NoError(t, yaml.Unmarshal(mapJsonData, &m2)) t.Logf("initial data = %s", string(data)) - t.Logf("unmarshalled map = %v", m1) + t.Logf("unmarshaled map = %v", m1) t.Logf("re-marshalled from map = %s", string(mapJsonData)) t.Logf("re-marshalled from test obj = %s", string(yamlData)) - t.Logf("re-unmarshalled map = %s", m2) + t.Logf("re-unmarshaled map = %s", m2) } }) } diff --git a/yaml_test.go b/yaml_test.go index 84e8e47..a8ad559 100644 --- a/yaml_test.go +++ b/yaml_test.go @@ -111,7 +111,7 @@ abc: true }) } -func TestUnmarshallYAML(t *testing.T) { +func TestUnmarshalYAML(t *testing.T) { t.Run("int key", func(t *testing.T) { data := ` 1: bar @@ -226,7 +226,7 @@ func TestYAMLSpecialCharacters(t *testing.T) { require.Equal(t, baselineData, b) }) - t.Run("unmarshall special characters", func(t *testing.T) { + t.Run("unmarshal special characters", func(t *testing.T) { om := New[string, any]() require.NoError(t, yaml.Unmarshal(baselineData, &om)) assertOrderedPairsEqual(t, om,