Newer
Older
dub_jkp / test / 4-describe-string-import-paths.sh
  1. #!/usr/bin/env bash
  2.  
  3. . $(dirname "${BASH_SOURCE[0]}")/common.sh
  4.  
  5. cd "$CURR_DIR"/describe-project
  6.  
  7. temp_file=$(mktemp $(basename $0).XXXXXX)
  8.  
  9. function cleanup {
  10. rm $temp_file
  11. }
  12.  
  13. trap cleanup EXIT
  14.  
  15. if ! $DUB describe --compiler=$DC --string-import-paths > "$temp_file"; then
  16. die $LINENO 'Printing string import paths failed!'
  17. fi
  18.  
  19. # Create the expected output path file to compare against.
  20. echo "$CURR_DIR/describe-project/views/" > "$CURR_DIR/expected-string-import-path-output"
  21. echo "$CURR_DIR/describe-dependency-2/some-extra-string-import-path/" >> "$CURR_DIR/expected-string-import-path-output"
  22. echo "$CURR_DIR/describe-dependency-3/dep3-string-import-path/" >> "$CURR_DIR/expected-string-import-path-output"
  23.  
  24. if ! diff "$CURR_DIR"/expected-string-import-path-output "$temp_file"; then
  25. die $LINENO 'The string import paths did not match the expected output!'
  26. fi
  27.