Skip to content

Commit

Permalink
Merge pull request #53 from codecrafters-io/CC-823
Browse files Browse the repository at this point in the history
CC-823 updated tester utils
  • Loading branch information
libmartinito authored Nov 17, 2023
2 parents 641328a + 2ccff9a commit b98c3aa
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 105 deletions.
8 changes: 4 additions & 4 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.7
github.com/codecrafters-io/tester-utils v0.2.10
github.com/go-git/go-billy/v5 v5.0.0
github.com/go-git/go-git/v5 v5.0.0
)
Expand All @@ -14,12 +14,12 @@ require (
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
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.12.0 // indirect
golang.org/x/sys v0.14.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
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/codecrafters-io/tester-utils v0.2.7 h1:PkYNYBrQRwFdw/kt3y1D3duqdiBrj5RYyT9wqJx5W2U=
github.com/codecrafters-io/tester-utils v0.2.7/go.mod h1:BeSLyqBpFxUwIm41QlnuRG7ZsabBXWE2Ga3LMFUXAPM=
github.com/codecrafters-io/tester-utils v0.2.10 h1:Xpu6wzgpRpiZPFNGWMRcJXwAZZ0Yb5Mv6IDOR319f+s=
github.com/codecrafters-io/tester-utils v0.2.10/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 All @@ -14,6 +16,8 @@ github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0=
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
Expand Down Expand Up @@ -42,6 +46,8 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU=
Expand Down Expand Up @@ -75,6 +81,8 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
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/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
28 changes: 14 additions & 14 deletions internal/test_helpers/fixtures/create_blob
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
Debug = true

[stage-1] Running tests for Stage #1: init
[stage-1] Running git init
[stage-1] Running tests for Stage #1: init
[stage-1] Running git init
[your_program] Initialized git directory
[stage-1] Test passed.
[stage-1] Test passed.

[stage-2] Running tests for Stage #2: read_blob
[stage-2] Running ./your_git.sh init
[stage-2] Running tests for Stage #2: read_blob
[stage-2] Running ./your_git.sh init
[your_program] Initialized git directory
[stage-2] Writing sample file
[stage-2] Running ./your_git.sh cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-2] Writing sample file
[stage-2] Running ./your_git.sh cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[your_program] dumpty dooby doo donkey horsey vanilla
[stage-2] Test passed.
[stage-2] Test passed.

[stage-3] Running tests for Stage #3: create_blob
[stage-3] Running ./your_git.sh init
[stage-3] Running tests for Stage #3: create_blob
[stage-3] Running ./your_git.sh init
[your_program] Initialized git directory
[stage-3] Writing sample file
[stage-3] Running ./your_git.sh hash-object -w donkey.txt
[stage-3] Writing sample file
[stage-3] Running ./your_git.sh hash-object -w donkey.txt
[your_program] 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-3] Running git cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-3] Test passed.
[stage-3] Running git cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-3] Test passed.
6 changes: 3 additions & 3 deletions internal/test_helpers/fixtures/init
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Debug = true

[stage-1] Running tests for Stage #1: init
[stage-1] Running git init
[stage-1] Running tests for Stage #1: init
[stage-1] Running git init
[your_program] Initialized git directory
[stage-1] Test passed.
[stage-1] Test passed.
16 changes: 8 additions & 8 deletions internal/test_helpers/fixtures/read_blob
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Debug = true

[stage-1] Running tests for Stage #1: init
[stage-1] Running git init
[stage-1] Running tests for Stage #1: init
[stage-1] Running git init
[your_program] Initialized git directory
[stage-1] Test passed.
[stage-1] Test passed.

[stage-2] Running tests for Stage #2: read_blob
[stage-2] Running ./your_git.sh init
[stage-2] Running tests for Stage #2: read_blob
[stage-2] Running ./your_git.sh init
[your_program] Initialized git directory
[stage-2] Writing sample file
[stage-2] Running ./your_git.sh cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-2] Writing sample file
[stage-2] Running ./your_git.sh cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[your_program] dumpty dooby doo donkey horsey vanilla
[stage-2] Test passed.
[stage-2] Test passed.
38 changes: 19 additions & 19 deletions internal/test_helpers/fixtures/read_tree
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
Debug = true

[stage-1] Running tests for Stage #1: init
[stage-1] Running git init
[stage-1] Running tests for Stage #1: init
[stage-1] Running git init
[your_program] Initialized git directory
[stage-1] Test passed.
[stage-1] Test passed.

[stage-2] Running tests for Stage #2: read_blob
[stage-2] Running ./your_git.sh init
[stage-2] Running tests for Stage #2: read_blob
[stage-2] Running ./your_git.sh init
[your_program] Initialized git directory
[stage-2] Writing sample file
[stage-2] Running ./your_git.sh cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-2] Writing sample file
[stage-2] Running ./your_git.sh cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[your_program] dumpty dooby doo donkey horsey vanilla
[stage-2] Test passed.
[stage-2] Test passed.

[stage-3] Running tests for Stage #3: create_blob
[stage-3] Running ./your_git.sh init
[stage-3] Running tests for Stage #3: create_blob
[stage-3] Running ./your_git.sh init
[your_program] Initialized git directory
[stage-3] Writing sample file
[stage-3] Running ./your_git.sh hash-object -w donkey.txt
[stage-3] Writing sample file
[stage-3] Running ./your_git.sh hash-object -w donkey.txt
[your_program] 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-3] Running git cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-3] Test passed.
[stage-3] Running git cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-3] Test passed.

[stage-4] Running tests for Stage #4: read_tree
[stage-4] Running ./your_git.sh init
[stage-4] Running tests for Stage #4: read_tree
[stage-4] Running ./your_git.sh init
[your_program] Initialized git directory
[stage-4] Writing a tree to git storage..
[stage-4] Running ./your_git.sh ls-tree --name-only 978c60262a761655b8429dbeb12f7dce351c6cd6
[stage-4] Writing a tree to git storage..
[stage-4] Running ./your_git.sh ls-tree --name-only 978c60262a761655b8429dbeb12f7dce351c6cd6
[your_program] humpty
[your_program] scooby
[your_program] vanilla
[stage-4] Test passed.
[stage-4] Test passed.
54 changes: 27 additions & 27 deletions internal/test_helpers/fixtures/write_tree
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
Debug = true

[stage-1] Running tests for Stage #1: init
[stage-1] Running git init
[stage-1] Running tests for Stage #1: init
[stage-1] Running git init
[your_program] Initialized git directory
[stage-1] Test passed.
[stage-1] Test passed.

[stage-2] Running tests for Stage #2: read_blob
[stage-2] Running ./your_git.sh init
[stage-2] Running tests for Stage #2: read_blob
[stage-2] Running ./your_git.sh init
[your_program] Initialized git directory
[stage-2] Writing sample file
[stage-2] Running ./your_git.sh cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-2] Writing sample file
[stage-2] Running ./your_git.sh cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[your_program] dumpty dooby doo donkey horsey vanilla
[stage-2] Test passed.
[stage-2] Test passed.

[stage-3] Running tests for Stage #3: create_blob
[stage-3] Running ./your_git.sh init
[stage-3] Running tests for Stage #3: create_blob
[stage-3] Running ./your_git.sh init
[your_program] Initialized git directory
[stage-3] Writing sample file
[stage-3] Running ./your_git.sh hash-object -w donkey.txt
[stage-3] Writing sample file
[stage-3] Running ./your_git.sh hash-object -w donkey.txt
[your_program] 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-3] Running git cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-3] Test passed.
[stage-3] Running git cat-file -p 32eb24247f1cc0f2aa44da05b849392063a9b9e7
[stage-3] Test passed.

[stage-4] Running tests for Stage #4: read_tree
[stage-4] Running ./your_git.sh init
[stage-4] Running tests for Stage #4: read_tree
[stage-4] Running ./your_git.sh init
[your_program] Initialized git directory
[stage-4] Writing a tree to git storage..
[stage-4] Running ./your_git.sh ls-tree --name-only 978c60262a761655b8429dbeb12f7dce351c6cd6
[stage-4] Writing a tree to git storage..
[stage-4] Running ./your_git.sh ls-tree --name-only 978c60262a761655b8429dbeb12f7dce351c6cd6
[your_program] humpty
[your_program] scooby
[your_program] vanilla
[stage-4] Test passed.
[stage-4] Test passed.

[stage-5] Running tests for Stage #5: write_tree
[stage-5] Running ./your_git.sh init
[stage-5] Running tests for Stage #5: write_tree
[stage-5] Running ./your_git.sh init
[your_program] Initialized git directory
[stage-5] Creating some files & directories
[stage-5] $ ./your_git.sh write-tree
[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-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.
Loading

0 comments on commit b98c3aa

Please sign in to comment.