diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-04-20 01:25:00 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-04-20 01:25:00 +0000 |
commit | c5cac7bf5edbf2f2df4e40be9339c6f642a4f9bf (patch) | |
tree | a6c24731f7f548627606ef34cd4a0d9040914f3d | |
parent | bbbc3604ea8929caee86551ea0028880316c4be6 (diff) | |
parent | 3f0ffb2e3d6c03069ddc73614aafc4fdc519b3f2 (diff) | |
download | go-creachadair-shell-build-tools-release.tar.gz |
Snap for 8474542 from 3f0ffb2e3d6c03069ddc73614aafc4fdc519b3f2 to build-tools-releasebuild-tools-release
Change-Id: Ide1fd034be272d20d8b262eb68d76ef6ff2369b2
-rw-r--r-- | METADATA | 12 | ||||
-rw-r--r-- | bitbucket-pipelines.yml | 10 | ||||
-rw-r--r-- | go.mod | 4 | ||||
-rw-r--r-- | go.sum | 4 | ||||
-rw-r--r-- | shell_test.go | 22 |
5 files changed, 27 insertions, 25 deletions
@@ -1,13 +1,15 @@ name: "go-creachadair-stringset" -description: - "The shell package implements basic shell command-line splitting." - +description: "The shell package implements basic shell command-line splitting." third_party { url { type: GIT value: "https://bitbucket.org/creachadair/shell.git" } - version: "v0.0.6" - last_upgrade_date { year: 2019 month: 06 day: 03 } + version: "v0.0.7" license_type: NOTICE + last_upgrade_date { + year: 2022 + month: 3 + day: 29 + } } diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index d4b1a14..8acd906 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -16,14 +16,8 @@ definitions: pipelines: default: # run on each push - step: - image: golang:1.9 + image: golang:1.16 <<: *Verify - step: - image: golang:1.10 - <<: *Verify - - step: - image: golang:1.11 - <<: *Verify - - step: - image: golang:1.12 + image: golang:1.17 <<: *Verify @@ -1,3 +1,5 @@ module bitbucket.org/creachadair/shell -go 1.12 +go 1.16 + +require github.com/google/go-cmp v0.5.6 @@ -0,0 +1,4 @@ +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/shell_test.go b/shell_test.go index c5564a3..c6ef732 100644 --- a/shell_test.go +++ b/shell_test.go @@ -3,11 +3,11 @@ package shell import ( "fmt" "io" - "io/ioutil" "log" - "reflect" "strings" "testing" + + "github.com/google/go-cmp/cmp" ) func TestQuote(t *testing.T) { @@ -100,8 +100,8 @@ func TestSplit(t *testing.T) { if ok != test.ok { t.Errorf("Split %#q: got valid=%v, want %v", test.in, ok, test.ok) } - if !reflect.DeepEqual(got, test.want) { - t.Errorf("Split %#q: got %+q, want %+q", test.in, got, test.want) + if diff := cmp.Diff(test.want, got); diff != "" { + t.Errorf("Split %#q: (-want, +got)\n%s", test.in, diff) } } } @@ -137,11 +137,11 @@ func TestScannerSplit(t *testing.T) { t.Errorf("Unexpected scan error: %v", s.Err()) } - if !reflect.DeepEqual(got, test.want) { - t.Errorf("Scanner split prefix: got %+q, want %+q", got, test.want) + if diff := cmp.Diff(test.want, got); diff != "" { + t.Errorf("Scanner split prefix: (-want, +got)\n%s", diff) } - if !reflect.DeepEqual(rest, test.rest) { - t.Errorf("Scanner split suffix: got %+q, want %+q", rest, test.rest) + if diff := cmp.Diff(test.rest, rest); diff != "" { + t.Errorf("Scanner split suffix: (-want, +got)\n%s", diff) } } } @@ -167,8 +167,8 @@ func TestRoundTrip(t *testing.T) { if !ok { t.Errorf("Split %+q: should be valid, but is not", s) } - if !reflect.DeepEqual(got, test) { - t.Errorf("Split %+q: got %q, want %q", s, got, test) + if diff := cmp.Diff(test, got); diff != "" { + t.Errorf("Split %+q: (-want, +got)\n%s", s, diff) } } } @@ -194,7 +194,7 @@ func ExampleScanner_Rest() { break } } - rest, err := ioutil.ReadAll(s.Rest()) + rest, err := io.ReadAll(s.Rest()) if err != nil { log.Fatal(err) } |