diff -Nru golang-github-viant-assertly-0.5.3/debian/changelog golang-github-viant-assertly-0.5.4/debian/changelog --- golang-github-viant-assertly-0.5.3/debian/changelog 2020-06-19 13:49:06.000000000 +0000 +++ golang-github-viant-assertly-0.5.4/debian/changelog 2020-06-22 16:20:54.000000000 +0000 @@ -1,3 +1,11 @@ +golang-github-viant-assertly (0.5.4-1) unstable; urgency=medium + + * New upstream release 0.5.4 + * debian/patches: + - Drop all upstreamed patches. + + -- Roger Shimizu Tue, 23 Jun 2020 01:20:54 +0900 + golang-github-viant-assertly (0.5.3-3) unstable; urgency=medium * debian/patches: diff -Nru golang-github-viant-assertly-0.5.3/debian/patches/0001-patched-nil-pointer.patch golang-github-viant-assertly-0.5.4/debian/patches/0001-patched-nil-pointer.patch --- golang-github-viant-assertly-0.5.3/debian/patches/0001-patched-nil-pointer.patch 2020-06-19 13:49:06.000000000 +0000 +++ golang-github-viant-assertly-0.5.4/debian/patches/0001-patched-nil-pointer.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -From: adrianwit -Date: Wed, 12 Feb 2020 20:30:05 -0800 -Subject: patched nil pointer - -(cherry picked from commit adf6a8c351198564771708e78169703c6c9cd021) ---- - path.go | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/path.go b/path.go -index 6c5b422..b6e8599 100644 ---- a/path.go -+++ b/path.go -@@ -60,12 +60,14 @@ func (p *dataPath) Key(field string) DataPath { - - keyDirective := NewDirective(keyPath) - keyPath.directive = keyDirective -- if len(p.directive.TimeLayouts) > 0 { -- if timeLayout, ok := p.directive.TimeLayouts[field]; ok { -- keyPath.directive.TimeLayout = timeLayout -+ if p.directive != nil { -+ if len(p.directive.TimeLayouts) > 0 { -+ if timeLayout, ok := p.directive.TimeLayouts[field]; ok { -+ keyPath.directive.TimeLayout = timeLayout -+ } - } -+ keyDirective.mergeFrom(p.directive) - } -- keyDirective.mergeFrom(p.directive) - return keyPath - } - diff -Nru golang-github-viant-assertly-0.5.3/debian/patches/0002-Skip-test-fails-at-git-pbuilder-environment.patch golang-github-viant-assertly-0.5.4/debian/patches/0002-Skip-test-fails-at-git-pbuilder-environment.patch --- golang-github-viant-assertly-0.5.3/debian/patches/0002-Skip-test-fails-at-git-pbuilder-environment.patch 2020-06-19 13:49:06.000000000 +0000 +++ golang-github-viant-assertly-0.5.4/debian/patches/0002-Skip-test-fails-at-git-pbuilder-environment.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -From: Roger Shimizu -Date: Fri, 19 Jun 2020 22:42:39 +0900 -Subject: Skip test fails at git-pbuilder environment - ---- - directive_test.go | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/directive_test.go b/directive_test.go -index 2761ab4..5736b22 100644 ---- a/directive_test.go -+++ b/directive_test.go -@@ -143,6 +143,7 @@ func TestDirective_Add(t *testing.T) { - - func TestAssertPath_Directive(t *testing.T) { - -+ t.Skip() - expected := `[ - { - "SubPath": "group1.field1", diff -Nru golang-github-viant-assertly-0.5.3/debian/patches/series golang-github-viant-assertly-0.5.4/debian/patches/series --- golang-github-viant-assertly-0.5.3/debian/patches/series 2020-06-19 13:49:06.000000000 +0000 +++ golang-github-viant-assertly-0.5.4/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -0001-patched-nil-pointer.patch -0002-Skip-test-fails-at-git-pbuilder-environment.patch diff -Nru golang-github-viant-assertly-0.5.3/directive_test.go golang-github-viant-assertly-0.5.4/directive_test.go --- golang-github-viant-assertly-0.5.3/directive_test.go 2020-05-02 09:37:58.000000000 +0000 +++ golang-github-viant-assertly-0.5.4/directive_test.go 2020-06-19 16:28:54.000000000 +0000 @@ -145,6 +145,9 @@ expected := `[ { + "@indexBy@":"SubPath" + }, + { "SubPath": "group1.field1", "Expected": 1 }, diff -Nru golang-github-viant-assertly-0.5.3/path.go golang-github-viant-assertly-0.5.4/path.go --- golang-github-viant-assertly-0.5.3/path.go 2020-05-02 09:37:58.000000000 +0000 +++ golang-github-viant-assertly-0.5.4/path.go 2020-06-19 16:28:54.000000000 +0000 @@ -60,12 +60,14 @@ keyDirective := NewDirective(keyPath) keyPath.directive = keyDirective - if len(p.directive.TimeLayouts) > 0 { - if timeLayout, ok := p.directive.TimeLayouts[field]; ok { - keyPath.directive.TimeLayout = timeLayout + if p.directive != nil { + if len(p.directive.TimeLayouts) > 0 { + if timeLayout, ok := p.directive.TimeLayouts[field]; ok { + keyPath.directive.TimeLayout = timeLayout + } } + keyDirective.mergeFrom(p.directive) } - keyDirective.mergeFrom(p.directive) return keyPath } diff -Nru golang-github-viant-assertly-0.5.3/validator.go golang-github-viant-assertly-0.5.4/validator.go --- golang-github-viant-assertly-0.5.3/validator.go 2020-05-02 09:37:58.000000000 +0000 +++ golang-github-viant-assertly-0.5.4/validator.go 2020-06-19 16:28:54.000000000 +0000 @@ -26,8 +26,8 @@ NotEqualViolation = "value should not be equal" LengthViolation = "should have the same length" MissingCaseViolation = "missing switch/case value" - RegExprMatchesViolation = "should match regrexp" - RegExprDoesNotMatchViolation = "should mot match regrexp" + RegExprMatchesViolation = "should match regexpr" + RegExprDoesNotMatchViolation = "should not match regexpr" RangeViolation = "should be in range" RangeNotViolation = "should not be in range" ContainsViolation = "should contain fragment" diff -Nru golang-github-viant-assertly-0.5.3/validator_test.go golang-github-viant-assertly-0.5.4/validator_test.go --- golang-github-viant-assertly-0.5.3/validator_test.go 2020-05-02 09:37:58.000000000 +0000 +++ golang-github-viant-assertly-0.5.4/validator_test.go 2020-06-19 16:28:54.000000000 +0000 @@ -175,6 +175,35 @@ }, { + Description: "two slice with index test", + Expected: []interface{}{ + map[string]interface{}{ + assertly.IndexByDirective: "id", + }, + map[string]interface{}{ + "id": 1, + "name": "name 1", + }, + map[string]interface{}{ + "id": 2, + "name": "name 2", + }, + }, + Actual: []interface{}{ + map[string]interface{}{ + "id": 2, + "name": "name 2", + }, + map[string]interface{}{ + "id": 1, + "name": "name 1", + }, + }, + PassedCount: 4, + FailedCount: 0, + }, + + { Description: "expected apply error", Expected: map[string]interface{}{ assertly.CastDataTypeDirective + "k2": "abc",