diff --git a/test/0-init-interactive.dub.sdl b/test/0-init-interactive.dub.sdl new file mode 100644 index 0000000..3eaf63c --- /dev/null +++ b/test/0-init-interactive.dub.sdl @@ -0,0 +1,5 @@ +name "test" +description "desc" +authors "author" +copyright "copy" +license "gpl" diff --git a/test/0-init-interactive.sh b/test/0-init-interactive.sh new file mode 100755 index 0000000..65065f3 --- /dev/null +++ b/test/0-init-interactive.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +packname="0-init-interactive" + +echo -e "sdl\ntest\ndesc\nauthor\ngpl\ncopy\n\n" | $DUB init $packname + +function cleanup { + rm -rf $packname +} + +if [ ! -e $packname/dub.sdl ]; then # it failed + echo "No dub.sdl file has been generated." + cleanup + exit 1 +fi + +if ! diff $packname/dub.sdl "$CURR_DIR"/0-init-interactive.dub.sdl; then + echo "Contents of generated dub.sdl not as expected." + cleanup + exit 1 +fi + +cleanup +exit 0