Skip to content

Commit

Permalink
Merge pull request #68 from codecrafters-io/CC-1192
Browse files Browse the repository at this point in the history
chores[deps]: tester-utils 0.2.20 upgrade
  • Loading branch information
ryan-gang authored Apr 29, 2024
2 parents ab5a246 + 1e7bc98 commit 6a4019f
Show file tree
Hide file tree
Showing 12 changed files with 86 additions and 243 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/codecrafters-io/git-tester
go 1.20

require (
github.com/codecrafters-io/tester-utils v0.2.18
github.com/codecrafters-io/tester-utils v0.2.20
github.com/go-git/go-billy/v5 v5.0.0
github.com/go-git/go-git/v5 v5.0.0
)
Expand All @@ -28,7 +28,7 @@ require (
github.com/xanzy/ssh-agent v0.2.1 // indirect
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 // indirect
golang.org/x/net v0.0.0-20200301022130-244492dfa37a // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/sys v0.19.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ github.com/codecrafters-io/tester-utils v0.2.17 h1:rO04TuOME773cZE729kIVOiXpZSq5
github.com/codecrafters-io/tester-utils v0.2.17/go.mod h1:BeSLyqBpFxUwIm41QlnuRG7ZsabBXWE2Ga3LMFUXAPM=
github.com/codecrafters-io/tester-utils v0.2.18 h1:fjIWERlzR1700Mogr8+30H3bYyLY+36KMU8ojloo3/0=
github.com/codecrafters-io/tester-utils v0.2.18/go.mod h1:BeSLyqBpFxUwIm41QlnuRG7ZsabBXWE2Ga3LMFUXAPM=
github.com/codecrafters-io/tester-utils v0.2.20 h1:t/IFFXOrSgRIoq6x4kUnRdjuai7EcwWH42Za25hvneA=
github.com/codecrafters-io/tester-utils v0.2.20/go.mod h1:BeSLyqBpFxUwIm41QlnuRG7ZsabBXWE2Ga3LMFUXAPM=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
Expand Down Expand Up @@ -93,6 +95,8 @@ golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
Expand Down
32 changes: 16 additions & 16 deletions internal/test_helpers/fixtures/create_blob
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
Debug = true

[stage-1] Running tests for Stage #1: init
[stage-1] $ ./your_git.sh init
[stage-3] Running tests for Stage #3: create_blob
[stage-3] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-1] .git directory found.
[stage-1] .git/objects directory found.
[stage-1] .git/refs directory found.
[stage-1] .git/HEAD file is valid.
[stage-1] Test passed.
[stage-3] $ echo "orange pear grape pineapple blueberry banana" > pear.txt
[stage-3] $ ./your_git.sh hash-object -w pear.txt
[your_program] 7a50e289f5bde85780a843d5750ec3ae372af50a
[stage-3] Output is a 40-char SHA.
[stage-3] Blob file contents are valid.
[stage-3] Returned SHA matches expected SHA.
[stage-3] Test passed.

[stage-2] Running tests for Stage #2: read_blob
[stage-2] $ ./your_git.sh init
Expand All @@ -18,13 +20,11 @@ Debug = true
[stage-2] Output is valid.
[stage-2] Test passed.

[stage-3] Running tests for Stage #3: create_blob
[stage-3] $ ./your_git.sh init
[stage-1] Running tests for Stage #1: init
[stage-1] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-3] $ echo "orange pear grape pineapple blueberry banana" > pear.txt
[stage-3] $ ./your_git.sh hash-object -w pear.txt
[your_program] 7a50e289f5bde85780a843d5750ec3ae372af50a
[stage-3] Output is a 40-char SHA.
[stage-3] Blob file contents are valid.
[stage-3] Returned SHA matches expected SHA.
[stage-3] Test passed.
[stage-1] .git directory found.
[stage-1] .git/objects directory found.
[stage-1] .git/refs directory found.
[stage-1] .git/HEAD file is valid.
[stage-1] Test passed.
18 changes: 0 additions & 18 deletions internal/test_helpers/fixtures/create_blob_failure
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
Debug = true

[stage-1] Running tests for Stage #1: init
[stage-1] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-1] .git directory found.
[stage-1] .git/objects directory found.
[stage-1] .git/refs directory found.
[stage-1] .git/HEAD file is valid.
[stage-1] Test passed.

[stage-2] Running tests for Stage #2: read_blob
[stage-2] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-2] Added blob object to .git/objects: 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-2] $ ./your_git.sh cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[your_program] dumpty dooby doo donkey horsey vanilla
[stage-2] Output is valid.
[stage-2] Test passed.

[stage-3] Running tests for Stage #3: create_blob
[stage-3] $ ./your_git.sh init
[your_program] Initialized git directory
Expand Down
18 changes: 0 additions & 18 deletions internal/test_helpers/fixtures/create_blob_no_file
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
Debug = true

[stage-1] Running tests for Stage #1: init
[stage-1] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-1] .git directory found.
[stage-1] .git/objects directory found.
[stage-1] .git/refs directory found.
[stage-1] .git/HEAD file is valid.
[stage-1] Test passed.

[stage-2] Running tests for Stage #2: read_blob
[stage-2] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-2] Added blob object to .git/objects: 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-2] $ ./your_git.sh cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[your_program] dumpty dooby doo donkey horsey vanilla
[stage-2] Output is valid.
[stage-2] Test passed.

[stage-3] Running tests for Stage #3: create_blob
[stage-3] $ ./your_git.sh init
[your_program] Initialized git directory
Expand Down
18 changes: 0 additions & 18 deletions internal/test_helpers/fixtures/create_blob_no_zlib
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
Debug = true

[stage-1] Running tests for Stage #1: init
[stage-1] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-1] .git directory found.
[stage-1] .git/objects directory found.
[stage-1] .git/refs directory found.
[stage-1] .git/HEAD file is valid.
[stage-1] Test passed.

[stage-2] Running tests for Stage #2: read_blob
[stage-2] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-2] Added blob object to .git/objects: 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-2] $ ./your_git.sh cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[your_program] dumpty dooby doo donkey horsey vanilla
[stage-2] Output is valid.
[stage-2] Test passed.

[stage-3] Running tests for Stage #3: create_blob
[stage-3] $ ./your_git.sh init
[your_program] Initialized git directory
Expand Down
18 changes: 9 additions & 9 deletions internal/test_helpers/fixtures/read_blob
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
Debug = true

[stage-1] Running tests for Stage #1: init
[stage-1] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-1] .git directory found.
[stage-1] .git/objects directory found.
[stage-1] .git/refs directory found.
[stage-1] .git/HEAD file is valid.
[stage-1] Test passed.

[stage-2] Running tests for Stage #2: read_blob
[stage-2] $ ./your_git.sh init
[your_program] Initialized git directory
Expand All @@ -17,3 +8,12 @@ Debug = true
[your_program] dumpty dooby doo donkey horsey vanilla
[stage-2] Output is valid.
[stage-2] Test passed.

[stage-1] Running tests for Stage #1: init
[stage-1] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-1] .git directory found.
[stage-1] .git/objects directory found.
[stage-1] .git/refs directory found.
[stage-1] .git/HEAD file is valid.
[stage-1] Test passed.
48 changes: 24 additions & 24 deletions internal/test_helpers/fixtures/read_tree
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
Debug = true

[stage-1] Running tests for Stage #1: init
[stage-1] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-1] .git directory found.
[stage-1] .git/objects directory found.
[stage-1] .git/refs directory found.
[stage-1] .git/HEAD file is valid.
[stage-1] Test passed.

[stage-2] Running tests for Stage #2: read_blob
[stage-2] $ ./your_git.sh init
[stage-4] Running tests for Stage #4: read_tree
[stage-4] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-2] Added blob object to .git/objects: 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-2] $ ./your_git.sh cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[your_program] dumpty dooby doo donkey horsey vanilla
[stage-2] Output is valid.
[stage-2] Test passed.
[stage-4] Writing a tree to git storage..
[stage-4] $ ./your_git.sh ls-tree --name-only 978c60262a761655b8429dbeb12f7dce351c6cd6
[your_program] humpty
[your_program] scooby
[your_program] vanilla
[stage-4] Test passed.

[stage-3] Running tests for Stage #3: create_blob
[stage-3] $ ./your_git.sh init
Expand All @@ -29,12 +21,20 @@ Debug = true
[stage-3] Returned SHA matches expected SHA.
[stage-3] Test passed.

[stage-4] Running tests for Stage #4: read_tree
[stage-4] $ ./your_git.sh init
[stage-2] Running tests for Stage #2: read_blob
[stage-2] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-4] Writing a tree to git storage..
[stage-4] $ ./your_git.sh ls-tree --name-only 978c60262a761655b8429dbeb12f7dce351c6cd6
[your_program] humpty
[your_program] scooby
[your_program] vanilla
[stage-4] Test passed.
[stage-2] Added blob object to .git/objects: 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-2] $ ./your_git.sh cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[your_program] dumpty dooby doo donkey horsey vanilla
[stage-2] Output is valid.
[stage-2] Test passed.

[stage-1] Running tests for Stage #1: init
[stage-1] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-1] .git directory found.
[stage-1] .git/objects directory found.
[stage-1] .git/refs directory found.
[stage-1] .git/HEAD file is valid.
[stage-1] Test passed.
29 changes: 0 additions & 29 deletions internal/test_helpers/fixtures/read_tree_exit_code_failure
Original file line number Diff line number Diff line change
@@ -1,34 +1,5 @@
Debug = true

[stage-1] Running tests for Stage #1: init
[stage-1] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-1] .git directory found.
[stage-1] .git/objects directory found.
[stage-1] .git/refs directory found.
[stage-1] .git/HEAD file is valid.
[stage-1] Test passed.

[stage-2] Running tests for Stage #2: read_blob
[stage-2] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-2] Added blob object to .git/objects: 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-2] $ ./your_git.sh cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[your_program] dumpty dooby doo donkey horsey vanilla
[stage-2] Output is valid.
[stage-2] Test passed.

[stage-3] Running tests for Stage #3: create_blob
[stage-3] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-3] $ echo "orange pear grape pineapple blueberry banana" > pear.txt
[stage-3] $ ./your_git.sh hash-object -w pear.txt
[your_program] 7a50e289f5bde85780a843d5750ec3ae372af50a
[stage-3] Output is a 40-char SHA.
[stage-3] Blob file contents are valid.
[stage-3] Returned SHA matches expected SHA.
[stage-3] Test passed.

[stage-4] Running tests for Stage #4: read_tree
[stage-4] $ ./your_git.sh init
[your_program] Initialized git directory
Expand Down
62 changes: 31 additions & 31 deletions internal/test_helpers/fixtures/write_tree
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
Debug = true

[stage-1] Running tests for Stage #1: init
[stage-1] $ ./your_git.sh init
[stage-5] Running tests for Stage #5: write_tree
[stage-5] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-1] .git directory found.
[stage-1] .git/objects directory found.
[stage-1] .git/refs directory found.
[stage-1] .git/HEAD file is valid.
[stage-1] Test passed.
[stage-5] Creating some files & directories
[stage-5] $ ./your_git.sh write-tree
[your_program] 7bba7df6498a0391b69e6343b517c3360b658293
[stage-5] Reading file at .git/objects/7b/ba7df6498a0391b69e6343b517c3360b658293
[stage-5] Found git object file written at .git/objects/7b/ba7df6498a0391b69e6343b517c3360b658293.
[stage-5] $ git ls-tree --name-only 7bba7df6498a0391b69e6343b517c3360b658293
[stage-5] Test passed.

[stage-2] Running tests for Stage #2: read_blob
[stage-2] $ ./your_git.sh init
[stage-4] Running tests for Stage #4: read_tree
[stage-4] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-2] Added blob object to .git/objects: 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-2] $ ./your_git.sh cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[your_program] dumpty dooby doo donkey horsey vanilla
[stage-2] Output is valid.
[stage-2] Test passed.
[stage-4] Writing a tree to git storage..
[stage-4] $ ./your_git.sh ls-tree --name-only 978c60262a761655b8429dbeb12f7dce351c6cd6
[your_program] humpty
[your_program] scooby
[your_program] vanilla
[stage-4] Test passed.

[stage-3] Running tests for Stage #3: create_blob
[stage-3] $ ./your_git.sh init
Expand All @@ -29,23 +32,20 @@ Debug = true
[stage-3] Returned SHA matches expected SHA.
[stage-3] Test passed.

[stage-4] Running tests for Stage #4: read_tree
[stage-4] $ ./your_git.sh init
[stage-2] Running tests for Stage #2: read_blob
[stage-2] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-4] Writing a tree to git storage..
[stage-4] $ ./your_git.sh ls-tree --name-only 978c60262a761655b8429dbeb12f7dce351c6cd6
[your_program] humpty
[your_program] scooby
[your_program] vanilla
[stage-4] Test passed.
[stage-2] Added blob object to .git/objects: 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-2] $ ./your_git.sh cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[your_program] dumpty dooby doo donkey horsey vanilla
[stage-2] Output is valid.
[stage-2] Test passed.

[stage-5] Running tests for Stage #5: write_tree
[stage-5] $ ./your_git.sh init
[stage-1] Running tests for Stage #1: init
[stage-1] $ ./your_git.sh init
[your_program] Initialized git directory
[stage-5] Creating some files & directories
[stage-5] $ ./your_git.sh write-tree
[your_program] 7bba7df6498a0391b69e6343b517c3360b658293
[stage-5] Reading file at .git/objects/7b/ba7df6498a0391b69e6343b517c3360b658293
[stage-5] Found git object file written at .git/objects/7b/ba7df6498a0391b69e6343b517c3360b658293.
[stage-5] $ git ls-tree --name-only 7bba7df6498a0391b69e6343b517c3360b658293
[stage-5] Test passed.
[stage-1] .git directory found.
[stage-1] .git/objects directory found.
[stage-1] .git/refs directory found.
[stage-1] .git/HEAD file is valid.
[stage-1] Test passed.
Loading

0 comments on commit 6a4019f

Please sign in to comment.