From fc8c5fdce62fb229202659408798a7b6c98f6e8b Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Fri, 28 Apr 2023 01:36:55 +0800 Subject: --- cli/internal/fs/hash_test.go | 53 -------------------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 cli/internal/fs/hash_test.go (limited to 'cli/internal/fs/hash_test.go') diff --git a/cli/internal/fs/hash_test.go b/cli/internal/fs/hash_test.go deleted file mode 100644 index dd2fa84..0000000 --- a/cli/internal/fs/hash_test.go +++ /dev/null @@ -1,53 +0,0 @@ -package fs - -import ( - "testing" - - "gotest.tools/v3/assert" -) - -const _numOfRuns = 20 - -func Test_HashObjectStability(t *testing.T) { - type TestCase struct { - name string - obj interface{} - } - type complexStruct struct { - nested TaskOutputs - foo string - bar []string - } - - testCases := []TestCase{ - { - name: "task object", - obj: TaskOutputs{ - Inclusions: []string{"foo", "bar"}, - Exclusions: []string{"baz"}, - }, - }, - { - name: "complex struct", - obj: complexStruct{ - nested: TaskOutputs{ - Exclusions: []string{"bar", "baz"}, - Inclusions: []string{"foo"}, - }, - foo: "a", - bar: []string{"b", "c"}, - }, - }, - } - - for _, tc := range testCases { - expectedHash, err := HashObject(tc.obj) - assert.NilError(t, err, tc.name) - - for n := 0; n < _numOfRuns; n++ { - hash, err := HashObject(tc.obj) - assert.NilError(t, err, tc.name) - assert.Equal(t, expectedHash, hash, tc.name) - } - } -} -- cgit v1.2.3-70-g09d2