Skip to content

Commit

Permalink
test: update fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-gang committed Apr 29, 2024
1 parent ddf0a62 commit 1e7bc98
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 241 deletions.
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.
39 changes: 0 additions & 39 deletions internal/test_helpers/fixtures/write_tree_err_not_exist_fail
Original file line number Diff line number Diff line change
@@ -1,44 +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
[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-5] Running tests for Stage #5: write_tree
[stage-5] $ ./your_git.sh init
[your_program] Initialized git directory
Expand Down
Loading

0 comments on commit 1e7bc98

Please sign in to comment.