Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #144 from darrenldl/dev
Browse files Browse the repository at this point in the history
Test suite update due to changed defaults, README polish
  • Loading branch information
darrenldl committed Apr 5, 2019
2 parents f652fd5 + 6a4414b commit 82c5cf3
Show file tree
Hide file tree
Showing 21 changed files with 36 additions and 36 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ cargo install blkar

#### Usage guides & screencasts & other resources

The [wiki](https://github.com/darrenldl/blockyarchive/wiki) contains comprehensive guides and resources.
The [wiki](https://github.com/darrenldl/blockyarchive/wiki) contains comprehensive guides and resources

## Note on Rust to Bash ratio

Expand Down Expand Up @@ -87,7 +87,7 @@ Contributions are welcome. Note that by submitting contributions, you agree to l

I would like to thank [Marco](https://github.com/MarcoPon) (the official SeqBox author) for discussing and clarifying aspects of his project, and also providing of test data during development of osbx. I would also like to thank him for his feedback on the numbering of the error correction enabled SBX versions (versions 17, 18, 19).

I would like to thank [Ming](https://github.com/mdchia/) for his feedback on the documentation, UX design, and several other general aspects of the osbx project, of which most of the designs are carried over to blkar, and also his further feedback on this project as well.
I would like to thank [Ming](https://github.com/mdchia/) for his feedback on the documentation, UX design, and several other general aspects of the osbx project, of which most of the designs are carried over to blkar, and also his further feedback on this project as well

The design of the readable rate in progress report text is copied from [Arch Linux pacman](https://wiki.archlinux.org/index.php/Pacman)'s progress bar design

Expand Down
6 changes: 3 additions & 3 deletions tests/decode_blanks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ corrupt() {

echo "Testing version 1"
echo "Encoding"
output=$(./../blkar encode --json -f dummy)
output=$(./../blkar encode --sbx-version 1 --json -f dummy)
if [[ $(echo $output | jq -r ".error") != "null" ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down Expand Up @@ -71,7 +71,7 @@ else
fi

echo "Encoding"
output=$(./../blkar encode --json -f dummy)
output=$(./../blkar encode --sbx-version 1 --json -f dummy)
if [[ $(echo $output | jq -r ".error") != "null" ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down Expand Up @@ -123,7 +123,7 @@ else
fi

echo "Encoding"
output=$(./../blkar encode --json -f dummy)
output=$(./../blkar encode --sbx-version 1 --json -f dummy)
if [[ $(echo $output | jq -r ".error") != "null" ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down
6 changes: 3 additions & 3 deletions tests/decode_blanks_decode_stdout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ corrupt() {

echo "Testing version 1"
echo "Encoding"
output=$(./../blkar encode --json -f dummy)
output=$(./../blkar encode --sbx-version 1 --json -f dummy)
if [[ $(echo $output | jq -r ".error") != "null" ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down Expand Up @@ -78,7 +78,7 @@ else
fi

echo "Encoding"
output=$(./../blkar encode --json -f dummy)
output=$(./../blkar encode --sbx-version 1 --json -f dummy)
if [[ $(echo $output | jq -r ".error") != "null" ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down Expand Up @@ -136,7 +136,7 @@ else
fi

echo "Encoding"
output=$(./../blkar encode --json -f dummy)
output=$(./../blkar encode --sbx-version 1 --json -f dummy)
if [[ $(echo $output | jq -r ".error") != "null" ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down
2 changes: 1 addition & 1 deletion tests/decode_from_to_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ file_size=$(ls -l dummy | awk '{ print $5 }')

echo "Testing version 1"
echo "Encoding"
output=$(./../blkar encode --json -f dummy)
output=$(./../blkar encode --sbx-version 1 --json -f dummy)
if [[ $(echo $output | jq -r ".error") != "null" ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down
2 changes: 1 addition & 1 deletion tests/decode_from_to_tests_decode_stdout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ corrupt() {

echo "Testing version 1"
echo "Encoding"
output=$(./../blkar encode --json -f dummy)
output=$(./../blkar encode --sbx-version 1 --json -f dummy)
if [[ $(echo $output | jq -r ".error") != "null" ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down
2 changes: 1 addition & 1 deletion tests/decode_from_to_tests_decode_stdout_force_misalign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ offset=$[1 + RANDOM % 100]

echo "Testing version 1"
echo "Encoding"
output=$(./../blkar encode --json -f dummy)
output=$(./../blkar encode --sbx-version 1 --json -f dummy)
if [[ $(echo $output | jq -r ".error") != "null" ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down
2 changes: 1 addition & 1 deletion tests/decode_from_to_tests_decode_stdout_rounding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ offset=$[1 + RANDOM % 100]

echo "Testing version 1"
echo "Encoding"
output=$(./../blkar encode --json -f dummy)
output=$(./../blkar encode --sbx-version 1 --json -f dummy)
if [[ $(echo $output | jq -r ".error") != "null" ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down
2 changes: 1 addition & 1 deletion tests/decode_from_to_tests_force_misalign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ file_size=$(ls -l dummy | awk '{ print $5 }')

echo "Testing version 1"
echo "Encoding"
output=$(./../blkar encode --json -f dummy)
output=$(./../blkar encode --sbx-version 1 --json -f dummy)
if [[ $(echo $output | jq -r ".error") != "null" ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down
2 changes: 1 addition & 1 deletion tests/decode_from_to_tests_rounding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ file_size=$(ls -l dummy | awk '{ print $5 }')

echo "Testing version 1"
echo "Encoding"
output=$(./../blkar encode --json -f dummy)
output=$(./../blkar encode --sbx-version 1 --json -f dummy)
if [[ $(echo $output | jq -r ".error") != "null" ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down
4 changes: 2 additions & 2 deletions tests/out_file_logic_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rm out_test/* &>/dev/null

echo -n "Testing encode output with no provided path"
rm dummy.sbx &>/dev/null
./../blkar encode dummy &>/dev/null
./../blkar encode --sbx-version 1 dummy &>/dev/null

if [ -f "dummy.sbx" ]; then
echo " ==> Okay"
Expand Down Expand Up @@ -75,7 +75,7 @@ truncate -s 1K dummy

echo "Encode with no metadata"
rm dummy.sbx &>/dev/null
./../blkar encode dummy --no-meta &>/dev/null
./../blkar encode --sbx-version 1 dummy --no-meta &>/dev/null

echo "Repeating same tests for decoding"
echo -n "Testing decode output with no provided path"
Expand Down
4 changes: 2 additions & 2 deletions tests/rescue_from_to_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ touch dummy_empty1
touch dummy_empty2

echo -n "Encoding 1st file"
output=$(./../blkar encode --json -f dummy_empty1 --uid DEADBEEF0001)
output=$(./../blkar encode --sbx-version 1 --json -f dummy_empty1 --uid DEADBEEF0001)
if [[ $(echo $output | jq -r ".error") != null ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand All @@ -20,7 +20,7 @@ else
fi

echo -n "Encoding 2nd file"
output=$(./../blkar encode --json -f dummy_empty2 --uid DEADBEEF0002)
output=$(./../blkar encode --sbx-version 1 --json -f dummy_empty2 --uid DEADBEEF0002)
if [[ $(echo $output | jq -r ".error") != null ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down
4 changes: 2 additions & 2 deletions tests/rescue_from_to_tests_encode_stdin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ touch dummy_empty2

echo -n "Encoding 1st file"
output=$(cat dummy_empty1 | \
./../blkar encode --json -f - dummy_empty1.sbx --uid DEADBEEF0001)
./../blkar encode --sbx-version 1 --json -f - dummy_empty1.sbx --uid DEADBEEF0001)
if [[ $(echo $output | jq -r ".error") != null ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand All @@ -22,7 +22,7 @@ fi

echo -n "Encoding 2nd file"
output=$(cat dummy_empty2 | \
./../blkar encode --json -f - dummy_empty2.sbx --uid DEADBEEF0002)
./../blkar encode --sbx-version 1 --json -f - dummy_empty2.sbx --uid DEADBEEF0002)
if [[ $(echo $output | jq -r ".error") != null ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down
4 changes: 2 additions & 2 deletions tests/rescue_from_to_tests_force_misalign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ touch dummy_empty1
touch dummy_empty2

echo -n "Encoding 1st file"
output=$(./../blkar encode --json -f dummy_empty1 --uid DEADBEEF0001)
output=$(./../blkar encode --sbx-version 1 --json -f dummy_empty1 --uid DEADBEEF0001)
if [[ $(echo $output | jq -r ".error") != null ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand All @@ -22,7 +22,7 @@ else
fi

echo -n "Encoding 2nd file"
output=$(./../blkar encode --json -f dummy_empty2 --uid DEADBEEF0002)
output=$(./../blkar encode --sbx-version 1 --json -f dummy_empty2 --uid DEADBEEF0002)
if [[ $(echo $output | jq -r ".error") != null ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down
4 changes: 2 additions & 2 deletions tests/rescue_from_to_tests_rounding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ touch dummy_empty1
touch dummy_empty2

echo -n "Encoding 1st file"
output=$(./../blkar encode --json -f dummy_empty1 --uid DEADBEEF0001)
output=$(./../blkar encode --sbx-version 1 --json -f dummy_empty1 --uid DEADBEEF0001)
if [[ $(echo $output | jq -r ".error") != null ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand All @@ -22,7 +22,7 @@ else
fi

echo -n "Encoding 2nd file"
output=$(./../blkar encode --json -f dummy_empty2 --uid DEADBEEF0002)
output=$(./../blkar encode --sbx-version 1 --json -f dummy_empty2 --uid DEADBEEF0002)
if [[ $(echo $output | jq -r ".error") != null ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down
6 changes: 3 additions & 3 deletions tests/rescue_pick_uid_tests_decode_stdout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ uid3=$(cat /dev/urandom | tr -dc 0-9A-F | fold -w 12 | head -n 1)
uid_unused=$(cat /dev/urandom | tr -dc 0-9a-f | fold -w 12 | head -n 1)

echo -n "Encoding files"
output=$(./../blkar encode --json --uid $uid1 -f dummy rescue_picky_uid1.sbx)
output=$(./../blkar encode --sbx-version 1 --json --uid $uid1 -f dummy rescue_picky_uid1.sbx)
if [[ $(echo $output | jq -r ".stats.fileUID") == "$uid1" ]]; then
echo -n " ==> Okay"
else
echo -n " ==> NOT okay"
exit_code=1
fi
output=$(./../blkar encode --json --uid $uid2 -f dummy rescue_picky_uid2.sbx)
output=$(./../blkar encode --sbx-version 1 --json --uid $uid2 -f dummy rescue_picky_uid2.sbx)
if [[ $(echo $output | jq -r ".stats.fileUID") == "$uid2" ]]; then
echo -n " ==> Okay"
else
echo -n " ==> NOT okay"
exit_code=1
fi
output=$(./../blkar encode --json --uid $uid3 -f dummy rescue_picky_uid3.sbx)
output=$(./../blkar encode --sbx-version 1 --json --uid $uid3 -f dummy rescue_picky_uid3.sbx)
if [[ $(echo $output | jq -r ".stats.fileUID") == "$uid3" ]]; then
echo " ==> Okay"
else
Expand Down
4 changes: 2 additions & 2 deletions tests/show_from_to_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ touch dummy_empty1
touch dummy_empty2

echo -n "Encoding 1st file"
output=$(./../blkar encode --json -f dummy_empty1 --uid DEADBEEF0001)
output=$(./../blkar encode --sbx-version 1 --json -f dummy_empty1 --uid DEADBEEF0001)
if [[ $(echo $output | jq -r ".error") != null ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand All @@ -20,7 +20,7 @@ else
fi

echo -n "Encoding 2nd file"
output=$(./../blkar encode --json -f dummy_empty2 --uid DEADBEEF0002)
output=$(./../blkar encode --sbx-version 1 --json -f dummy_empty2 --uid DEADBEEF0002)
if [[ $(echo $output | jq -r ".error") != null ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down
4 changes: 2 additions & 2 deletions tests/show_from_to_tests_force_misalign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ touch dummy_empty1
touch dummy_empty2

echo -n "Encoding 1st file"
output=$(./../blkar encode --json -f dummy_empty1 --uid DEADBEEF0001)
output=$(./../blkar encode --sbx-version 1 --json -f dummy_empty1 --uid DEADBEEF0001)
if [[ $(echo $output | jq -r ".error") != null ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand All @@ -22,7 +22,7 @@ else
fi

echo -n "Encoding 2nd file"
output=$(./../blkar encode --json -f dummy_empty2 --uid DEADBEEF0002)
output=$(./../blkar encode --sbx-version 1 --json -f dummy_empty2 --uid DEADBEEF0002)
if [[ $(echo $output | jq -r ".error") != null ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down
4 changes: 2 additions & 2 deletions tests/show_from_to_tests_rounding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ touch dummy_empty1
touch dummy_empty2

echo -n "Encoding 1st file"
output=$(./../blkar encode --json -f dummy_empty1 --uid DEADBEEF0001)
output=$(./../blkar encode --sbx-version 1 --json -f dummy_empty1 --uid DEADBEEF0001)
if [[ $(echo $output | jq -r ".error") != null ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand All @@ -22,7 +22,7 @@ else
fi

echo -n "Encoding 2nd file"
output=$(./../blkar encode --json -f dummy_empty2 --uid DEADBEEF0002)
output=$(./../blkar encode --sbx-version 1 --json -f dummy_empty2 --uid DEADBEEF0002)
if [[ $(echo $output | jq -r ".error") != null ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down
2 changes: 1 addition & 1 deletion tests/sort_from_to_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ file_size=$(ls -l dummy | awk '{ print $5 }')

echo "Testing version 1"
echo "Encoding"
output=$(./../blkar encode --json -f dummy)
output=$(./../blkar encode --sbx-version 1 --json -f dummy)
if [[ $(echo $output | jq -r ".error") != "null" ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down
2 changes: 1 addition & 1 deletion tests/sort_from_to_tests_force_misalign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ file_size=$(ls -l dummy | awk '{ print $5 }')

echo "Testing version 1"
echo "Encoding"
output=$(./../blkar encode --json -f dummy)
output=$(./../blkar encode --sbx-version 1 --json -f dummy)
if [[ $(echo $output | jq -r ".error") != "null" ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down
2 changes: 1 addition & 1 deletion tests/sort_from_to_tests_rounding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ file_size=$(ls -l dummy | awk '{ print $5 }')

echo "Testing version 1"
echo "Encoding"
output=$(./../blkar encode --json -f dummy)
output=$(./../blkar encode --sbx-version 1 --json -f dummy)
if [[ $(echo $output | jq -r ".error") != "null" ]]; then
echo " ==> Invalid JSON"
exit_code=1
Expand Down

0 comments on commit 82c5cf3

Please sign in to comment.