From b8113671d8e0260d03d8619581c78b4da62c14ec Mon Sep 17 00:00:00 2001 From: sundowndev Date: Mon, 29 Mar 2021 11:28:34 +0200 Subject: [PATCH] test(analyser): fix sorting in expected result --- pkg/analyser/analyzer_test.go | 124 +++++++++++++++++----------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/pkg/analyser/analyzer_test.go b/pkg/analyser/analyzer_test.go index 0d6299e1..5d862d41 100644 --- a/pkg/analyser/analyzer_test.go +++ b/pkg/analyser/analyzer_test.go @@ -223,6 +223,17 @@ func TestAnalyze(t *testing.T) { }{"baz", "bar"}, }, Changelog: Changelog{ + { + Change: diff.Change{ + Type: "update", + From: "barfoo", + To: "foobar", + Path: []string{ + "BarFoo", + }, + }, + Computed: true, + }, { Change: diff.Change{ Type: "update", @@ -236,13 +247,13 @@ func TestAnalyze(t *testing.T) { { Change: diff.Change{ Type: "update", - From: "barfoo", - To: "foobar", + From: "bar", + To: "baz", Path: []string{ - "BarFoo", + "Struct", + "Bar", }, }, - Computed: true, }, { Change: diff.Change{ @@ -256,17 +267,6 @@ func TestAnalyze(t *testing.T) { }, Computed: true, }, - { - Change: diff.Change{ - Type: "update", - From: "bar", - To: "baz", - Path: []string{ - "Struct", - "Bar", - }, - }, - }, }, }, }, @@ -568,6 +568,17 @@ func TestAnalyze(t *testing.T) { }, }, Changelog: Changelog{ + { + Change: diff.Change{ + Type: "update", + From: "barfoo", + To: "foobar", + Path: []string{ + "BarFoo", + }, + }, + Computed: true, + }, { Change: diff.Change{ Type: "update", @@ -581,13 +592,13 @@ func TestAnalyze(t *testing.T) { { Change: diff.Change{ Type: "update", - From: "barfoo", - To: "foobar", + From: "bar", + To: "baz", Path: []string{ - "BarFoo", + "Struct", + "Bar", }, }, - Computed: true, }, { Change: diff.Change{ @@ -604,13 +615,16 @@ func TestAnalyze(t *testing.T) { { Change: diff.Change{ Type: "update", - From: "bar", - To: "baz", + From: "foo", + To: "oof", Path: []string{ - "Struct", - "Bar", + "StructSlice", + "0", + "Array", + "0", }, }, + Computed: true, }, { Change: diff.Change{ @@ -625,20 +639,6 @@ func TestAnalyze(t *testing.T) { }, Computed: true, }, - { - Change: diff.Change{ - Type: "update", - From: "foo", - To: "oof", - Path: []string{ - "StructSlice", - "0", - "Array", - "0", - }, - }, - Computed: true, - }, }, }, }, @@ -765,18 +765,6 @@ func TestAnalyze(t *testing.T) { }{"baz", "bar"}, }, Changelog: Changelog{ - { - Change: diff.Change{ - Type: "update", - From: "baz", - To: "bazdiff", - Path: []string{ - "Struct", - "Baz", - }, - }, - Computed: true, - }, { Change: diff.Change{ Type: "update", @@ -789,6 +777,18 @@ func TestAnalyze(t *testing.T) { }, Computed: false, }, + { + Change: diff.Change{ + Type: "update", + From: "baz", + To: "bazdiff", + Path: []string{ + "Struct", + "Baz", + }, + }, + Computed: true, + }, }, }, { @@ -821,19 +821,6 @@ func TestAnalyze(t *testing.T) { }, Computed: true, }, - { - Change: diff.Change{ - Type: "update", - From: "one", - To: "onediff", - Path: []string{ - "StructSlice", - "0", - "String", - }, - }, - Computed: true, - }, { Change: diff.Change{ Type: "create", @@ -848,6 +835,19 @@ func TestAnalyze(t *testing.T) { }, Computed: true, }, + { + Change: diff.Change{ + Type: "update", + From: "one", + To: "onediff", + Path: []string{ + "StructSlice", + "0", + "String", + }, + }, + Computed: true, + }, }, }, },