Skip to content

Commit

Permalink
test: add no diff case
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Liu <[email protected]>
  • Loading branch information
austin362667 committed Mar 27, 2024
1 parent cff01cf commit 04c34ba
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion flyteadmin/pkg/errors/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestNewIncompatibleClusterError(t *testing.T) {
assert.True(t, ok)
}

func TestJsonDifferError(t *testing.T) {
func TestJsonDifferHasDiffError(t *testing.T) {
oldSpec := map[string]int{
"one": 1,
"two": 2,
Expand All @@ -77,6 +77,27 @@ func TestJsonDifferError(t *testing.T) {
assert.Equal(t, "\t\t- /four: 4 -> 0", strings.Join(rs, "\n"))
}

func TestJsonDifferNoDiffError(t *testing.T) {
oldSpec := map[string]int{
"one": 1,
"two": 2,
"three": 3,
"four": 4,
"five": 5,
}
newSpec := map[string]int{
"five": 5,
"four": 4,
"three": 3,
"two": 2,
"one": 1,
}
diff, _ := jsondiff.Compare(oldSpec, newSpec)
rdiff, _ := jsondiff.Compare(newSpec, oldSpec)
rs := compareJsons(diff, rdiff)
assert.Equal(t, "", strings.Join(rs, "\n"))
}

func TestNewTaskExistsDifferentStructureError(t *testing.T) {
req := &admin.TaskCreateRequest{
Id: &identifier,
Expand Down

0 comments on commit 04c34ba

Please sign in to comment.