@@ -10,7 +10,7 @@ load './util/init.sh'
1010# ___global_trap_table___ is an associative array. If that variable is not an associative
1111# array, indexing with 'nokey' still yields the value of the (string) variable (no error
1212# will be thrown). Now that 'core.init' is automatically called when the array is not
13- # defined (to be an associative array), these checks are unecessary (yet, they still exist)
13+ # defined (to be an associative array), these checks are unnecessary (yet, they still exist)
1414
1515@test " core.trap_add fails when function is not supplied" {
1616 run core.trap_add ' ' ' USR1'
@@ -20,7 +20,7 @@ load './util/init.sh'
2020}
2121
2222@test " core.trap_add fails when signal is not supplied" {
23- run core.trap_add ' function'
23+ run core.trap_add ' function'
2424
2525 assert_failure
2626 assert_output -p " Must specify at least one signal"
@@ -51,7 +51,7 @@ load './util/init.sh'
5151 BASALT_PACKAGE_DIR=$BASALT_PACKAGE_DIR run bash -c "
5252 cd \"\$ BASALT_PACKAGE_DIR/tests\" || { printf '%s\n' 'Failed to cd'; exit 1; }
5353 source ./util/init.sh
54-
54+
5555 somefunction() { printf '%s\n' 'a'; }
5656 core.trap_add 'somefunction' 'USR1'
5757 kill -USR1 \$\$ "
@@ -72,7 +72,7 @@ load './util/init.sh'
7272 BASALT_PACKAGE_DIR=$BASALT_PACKAGE_DIR run bash -c "
7373 cd \"\$ BASALT_PACKAGE_DIR/tests\" || { printf '%s\n' 'Failed to cd'; exit 1; }
7474 source ./util/init.sh
75-
75+
7676 somefunction() { printf '%s\n' 'a'; }
7777 somefunction2() { printf '%s\n' 'b'; }
7878 core.trap_add 'somefunction' 'USR1'
@@ -93,11 +93,11 @@ load './util/init.sh'
9393 [ " ${___global_trap_table___[USR1]} " = $' \x1C somefunction\x1C somefunction2' ]
9494}
9595
96- @test " core.trap_add adds function properly 3" {
96+ @test " core.trap_add adds function properly 3" {
9797 BASALT_PACKAGE_DIR=$BASALT_PACKAGE_DIR run bash -c "
9898 cd \"\$ BASALT_PACKAGE_DIR/tests\" || { printf '%s\n' 'Failed to cd'; exit 1; }
9999 source ./util/init.sh
100-
100+
101101 somefunction() { printf '%s\n' 'a'; }
102102 core.trap_add 'somefunction' 'USR1' 'USR2'
103103 kill -USR1 \$\$
@@ -110,7 +110,7 @@ load './util/init.sh'
110110@test " core.trap_add adds function properly 3 (variable)" {
111111 somefunction () { : ; }
112112 core.trap_add ' somefunction' ' USR1' ' USR2'
113-
113+
114114 [ " ${___global_trap_table___[nokey]} " != $' \x1C somefunction' ]
115115 [ " ${___global_trap_table___[USR1]} " = $' \x1C somefunction' ]
116116 [ " ${___global_trap_table___[USR2]} " = $' \x1C somefunction' ]
@@ -124,7 +124,7 @@ load './util/init.sh'
124124}
125125
126126@test " core.trap_remove fails when signal is not supplied" {
127- run core.trap_remove ' function'
127+ run core.trap_remove ' function'
128128
129129 assert_failure
130130 assert_output -p " Must specify at least one signal"
@@ -148,7 +148,7 @@ load './util/init.sh'
148148 BASALT_PACKAGE_DIR=$BASALT_PACKAGE_DIR run bash -c "
149149 cd \"\$ BASALT_PACKAGE_DIR/tests\" || { printf '%s\n' 'Failed to cd'; exit 1; }
150150 source ./util/init.sh
151-
151+
152152 somefunction() { printf '%s\n' 'a'; }
153153 core.trap_add 'somefunction' 'USR1'
154154 core.trap_remove 'somefunction' 'USR1'
@@ -171,7 +171,7 @@ load './util/init.sh'
171171 BASALT_PACKAGE_DIR=$BASALT_PACKAGE_DIR run bash -c "
172172 cd \"\$ BASALT_PACKAGE_DIR/tests\" || { printf '%s\n' 'Failed to cd'; exit 1; }
173173 source ./util/init.sh
174-
174+
175175 somefunction() { printf '%s\n' 'a'; }
176176 somefunction2() { printf '%s\n' 'b'; }
177177 core.trap_add 'somefunction' 'USR1'
@@ -198,7 +198,7 @@ load './util/init.sh'
198198 BASALT_PACKAGE_DIR=$BASALT_PACKAGE_DIR run bash -c "
199199 cd \"\$ BASALT_PACKAGE_DIR/tests\" || { printf '%s\n' 'Failed to cd'; exit 1; }
200200 source ./util/init.sh
201-
201+
202202 somefunction() { printf '%s\n' 'a'; }
203203 somefunction2() { printf '%s\n' 'b'; }
204204 core.trap_add 'somefunction' 'USR1'
@@ -226,7 +226,7 @@ load './util/init.sh'
226226 BASALT_PACKAGE_DIR=$BASALT_PACKAGE_DIR run bash -c "
227227 cd \"\$ BASALT_PACKAGE_DIR/tests\" || { printf '%s\n' 'Failed to cd'; exit 1; }
228228 source ./util/init.sh
229-
229+
230230 somefunction() { printf '%s\n' 'a'; }
231231 somefunction2() { printf '%s\n' 'b'; }
232232 core.trap_add 'somefunction' 'USR1'
@@ -253,7 +253,7 @@ load './util/init.sh'
253253 BASALT_PACKAGE_DIR=$BASALT_PACKAGE_DIR run bash -c "
254254 cd \"\$ BASALT_PACKAGE_DIR/tests\"
255255 source ./util/init.sh
256-
256+
257257 somefunction() { return 33; }
258258 core.trap_add 'somefunction' 'USR1'
259259 kill -USR1 \$\$
@@ -267,7 +267,7 @@ load './util/init.sh'
267267 BASALT_PACKAGE_DIR=$BASALT_PACKAGE_DIR run bash -c "
268268 cd \"\$ BASALT_PACKAGE_DIR/tests\"
269269 source ./util/init.sh
270-
270+
271271 somefunction() { return 33; }
272272 core.trap_add 'somefunction' 'USR1'
273273 unset -f somefunction
@@ -276,4 +276,4 @@ load './util/init.sh'
276276
277277 assert_success
278278 assert_output -p " Trap handler function 'somefunction' that was registered for signal 'USR1' no longer exists"
279- }
279+ }
0 commit comments