Skip to content

Commit c1c0540

Browse files
committed
[Tests] add debug info to failure message
1 parent cd22c84 commit c1c0540

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/install_script/nvm_detect_profile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,56 +96,56 @@ fi
9696
# It should favor .profile if file exists
9797
NVM_DETECT_PROFILE="$(unset SHELL; nvm_detect_profile)"
9898
if [ "$NVM_DETECT_PROFILE" != "$HOME/.profile" ]; then
99-
die "nvm_detect_profile should have selected .profile"
99+
die "nvm_detect_profile should have selected .profile; got $NVM_DETECT_PROFILE"
100100
fi
101101

102102
# Otherwise, it should favor .bashrc if file exists
103103
rm ".profile"
104104
NVM_DETECT_PROFILE="$(unset SHELL; nvm_detect_profile)"
105105
if [ "$NVM_DETECT_PROFILE" != "$HOME/.bashrc" ]; then
106-
die "nvm_detect_profile should have selected .bashrc"
106+
die "nvm_detect_profile should have selected .bashrc; got $NVM_DETECT_PROFILE"
107107
fi
108108

109109
# Otherwise, it should favor .bash_profile if file exists
110110
rm ".bashrc"
111111
NVM_DETECT_PROFILE="$(unset SHELL; nvm_detect_profile)"
112112
if [ "$NVM_DETECT_PROFILE" != "$HOME/.bash_profile" ]; then
113-
die "nvm_detect_profile should have selected .bash_profile"
113+
die "nvm_detect_profile should have selected .bash_profile; got $NVM_DETECT_PROFILE"
114114
fi
115115

116116
# Otherwise, it should favor zdotdir/.zprofile if file exists
117117
rm ".bash_profile"
118118
NVM_DETECT_PROFILE="$(unset SHELL; nvm_detect_profile)"
119119
if [ "$NVM_DETECT_PROFILE" != "$ZDOTDIR/.zprofile" ]; then
120-
die "nvm_detect_profile should have selected zdotdir/.zprofile"
120+
die "nvm_detect_profile should have selected zdotdir/.zprofile; got $NVM_DETECT_PROFILE"
121121
fi
122122

123123
# Otherwise, it should favor .zprofile if file exists
124124
rm "zdotdir/.zprofile"
125125
NVM_DETECT_PROFILE="$(unset SHELL; unset ZDOTDIR; nvm_detect_profile)"
126126
if [ "$NVM_DETECT_PROFILE" != "$HOME/.zprofile" ]; then
127-
die "nvm_detect_profile should have selected .zprofile"
127+
die "nvm_detect_profile should have selected .zprofile; got $NVM_DETECT_PROFILE"
128128
fi
129129

130130
# Otherwise, it should favor zdotdir/.zshrc if file exists
131131
rm ".zprofile"
132132
NVM_DETECT_PROFILE="$(unset SHELL; nvm_detect_profile)"
133133
if [ "$NVM_DETECT_PROFILE" != "$ZDOTDIR/.zshrc" ]; then
134-
die "nvm_detect_profile should have selected zdotdir/.zshrc"
134+
die "nvm_detect_profile should have selected zdotdir/.zshrc; got $NVM_DETECT_PROFILE"
135135
fi
136136

137137
# Otherwise, it should favor .zshrc if file exists
138138
rm "zdotdir/.zshrc"
139139
NVM_DETECT_PROFILE="$(unset SHELL; unset ZDOTDIR; nvm_detect_profile)"
140140
if [ "$NVM_DETECT_PROFILE" != "$HOME/.zshrc" ]; then
141-
die "nvm_detect_profile should have selected .zshrc"
141+
die "nvm_detect_profile should have selected .zshrc; got $NVM_DETECT_PROFILE"
142142
fi
143143

144144
# It should be empty if none is found
145145
rm ".zshrc"
146146
NVM_DETECT_PROFILE="$(unset SHELL; nvm_detect_profile)"
147147
if [ ! -z "$NVM_DETECT_PROFILE" ]; then
148-
die "nvm_detect_profile should have returned an empty value"
148+
die "nvm_detect_profile should have returned an empty value; got $NVM_DETECT_PROFILE"
149149
fi
150150

151151
cleanup

0 commit comments

Comments
 (0)