File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ USER_PWD="\$PWD"
1717export USER_PWD
1818ARCHIVE_DIR=\` dirname "\$ 0"\`
1919export ARCHIVE_DIR
20+ ARCHIVE_NAME=\` basename "\$ 0"\`
21+ export ARCHIVE_NAME
2022
2123label="$LABEL "
2224script="$SCRIPT "
Original file line number Diff line number Diff line change 33THIS=" $( readlink -f " $0 " ) "
44THISDIR=" $( dirname " ${THIS} " ) "
55SUT=" $( dirname " ${THISDIR} " ) /makeself.sh"
6+ ARCHIVE_NAME=" makeself-test.run"
67
78setupTests () {
89 temp=` mktemp -d -t XXXXX`
@@ -11,7 +12,7 @@ setupTests() {
1112 touch archive/file
1213
1314 # $SUT archive makeself-test.run "Test $1" declare -p "${1}"
14- $SUT archive makeself-test.run " Test $1 " echo \\\"\$ {${1} }\\\"
15+ $SUT archive " ${ARCHIVE_NAME} " " Test $1 " echo \\\"\$ {${1} }\\\"
1516}
1617
1718testArchiveDir ()
@@ -48,5 +49,17 @@ testUserPWD()
4849 assertEquals " ${actual_user_pwd} " " ${ans} "
4950}
5051
52+ testArchiveName ()
53+ {
54+ setupTests ARCHIVE_NAME
55+ local ans=" ${temp} " $' /complicated\n dir\t with spaces'
56+ mkdir -p " ${ans} "
57+ cd " ${ans} "
58+
59+ actual_archive_name=" $( " ${temp} /makeself-test.run" --quiet) "
60+
61+ assertEquals " ${actual_archive_name} " " ${ARCHIVE_NAME} "
62+ }
63+
5164# Load and run shUnit2.
5265source " ./shunit2/shunit2"
You can’t perform that action at this time.
0 commit comments