Skip to content

Commit

Permalink
tests/dep_tree: Generate test files using printf(1)
Browse files Browse the repository at this point in the history
  • Loading branch information
obiwac committed Dec 9, 2024
1 parent 4422917 commit 7802a39
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/dep_tree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ fi
DEP1=$(find $BOB_DEPS_PATH -name "*dep1*")
DEP2=$(find $BOB_DEPS_PATH -name "*dep2*")

echo -e "$DEP1" > $DEPS_TREE_PATH.expected
echo -e "\t$DEP2" >> $DEPS_TREE_PATH.expected
echo -e "$DEP2" >> $DEPS_TREE_PATH.expected
printf "$DEP1\n" > $DEPS_TREE_PATH.expected
printf "\t$DEP2\n" >> $DEPS_TREE_PATH.expected
printf "$DEP2\n" >> $DEPS_TREE_PATH.expected

if ! diff $DEPS_TREE_PATH $DEPS_TREE_PATH.expected; then
echo "Dependency tree differed to the one expected." >&2
Expand All @@ -56,8 +56,8 @@ fi
cp tests/deps/build.changed.fl tests/deps/build.fl
try "Failed to create dependency tree after changing dependencies"

echo -e "$DEP1" > $DEPS_TREE_PATH.expected
echo -e "\t$DEP2" >> $DEPS_TREE_PATH.expected
printf "$DEP1\n" > $DEPS_TREE_PATH.expected
printf "\t$DEP2\n" >> $DEPS_TREE_PATH.expected

if ! diff $DEPS_TREE_PATH $DEPS_TREE_PATH.expected; then
echo "Dependency tree differed to the one expected after changing dependencies." >&2
Expand All @@ -69,7 +69,7 @@ fi
cp tests/deps/build.duplicate.fl tests/deps/build.fl
try "Failed to create dependency tree with duplicates in the dependency vector"

echo -e "$DEP2" > $DEPS_TREE_PATH.expected
printf "$DEP2\n" > $DEPS_TREE_PATH.expected

if ! diff $DEPS_TREE_PATH $DEPS_TREE_PATH.expected; then
echo "Dependency tree differed to the one expected with duplicates in the dependency vector." >&2
Expand Down

0 comments on commit 7802a39

Please sign in to comment.