@@ -72,8 +72,8 @@ function echo_test_result() {
7272 fi
7373}
7474
75- # Test parse_java_property. This takes in three parameters, the name of the config,
76- # the expected value, and whether or not to ignore whitespace (e.g. for multi-line) .
75+ # Test parse_java_property. This takes in three parameters, the name of
76+ # the config, the expected value, and whether or not to ignore whitespace.
7777function test_parse_java_property() {
7878 key=" $1 "
7979 expected_value=" $2 "
@@ -166,20 +166,25 @@ for delimiter in "${delimiters[@]}"; do
166166 test_parse_java_property " spark.$delimiter .3" " -Dstraw=\" berry again\" "
167167 test_parse_java_property " spark.$delimiter .4" " -Dstraw=\" berry \\\" quote\" "
168168 test_parse_java_property " spark.$delimiter .5" " -Dstraw=\" berry \\\\ backslash\" "
169- test_parse_java_property " spark.$delimiter .6" " -Dstraw=\" berry \\\" quotes\\\" and \\\\ backslashes\\\\ \" "
170- test_parse_java_property " spark.$delimiter .7" " -Dstraw=berry -Dblue=berry -Dblack=berry"
171- test_parse_java_property " spark.$delimiter .8" " -Dstraw=\" berry space\" -Dblue=\" berry\" -Dblack=berry"
169+ test_parse_java_property " spark.$delimiter .6" \
170+ " -Dstraw=\" berry \\\" quotes\\\" and \\\\ backslashes\\\\ \" "
171+ test_parse_java_property " spark.$delimiter .7" \
172+ " -Dstraw=berry -Dblue=berry -Dblack=berry"
173+ test_parse_java_property " spark.$delimiter .8" \
174+ " -Dstraw=\" berry space\" -Dblue=\" berry\" -Dblack=berry"
172175 test_parse_java_property " spark.$delimiter .9" \
173176 " -Dstraw=\" berry space\" -Dblue=\" berry \\\" quotes\\\"\" -Dblack=\" berry \\\\ backslashes\\\\ \" "
174177 test_parse_java_property " spark.$delimiter .10" \
175- " -Dstraw=\" berry space\" -Dblue=\" berry \\\" quotes\\\"\" -Dblack=\" berry \\\\ backslashes\\\\ \" " IGNORE_WHITESPACE
178+ " -Dstraw=\" berry space\" -Dblue=\" berry \\\" quotes\\\"\" -Dblack=\" berry \\\\ backslashes\\\\ \" " \
179+ IGNORE_WHITESPACE
176180done
177181log_error
178182
179183# Test split_java_options. Note that this relies on parse_java_property to work correctly.
180184log_error " --- Testing split_java_options ---"
181185if [[ " $tests_failed " == 1 ]]; then
182- log_error " * WARNING: Tests for parse_java_property failed! This should also fail tests for split_java_options"
186+ log_error " * WARNING: Tests for parse_java_property failed!"
187+ log_error " This should also fail tests for split_java_options"
183188fi
184189test_split_java_options " spark.space.1" 1 " -Dstraw=berry"
185190test_split_java_options " spark.space.2" 1 " -Dstraw=berry"
@@ -198,16 +203,20 @@ log_error
198203# Test quote_java_property. Note that this relies on split_java_options to work correctly.
199204log_error " --- Testing quote_java_property ---"
200205if [[ " $tests_failed " == 1 ]]; then
201- log_error " * WARNING: Tests for split_java_options failed! This should also fail tests for quote_java_property"
206+ log_error " * WARNING: Tests for split_java_options failed!"
207+ log_error " This should also fail tests for quote_java_property"
202208fi
203209test_quote_java_property " spark.space.1" 1 " \" -Dstraw=berry\" "
204210test_quote_java_property " spark.space.2" 1 " \" -Dstraw=berry\" "
205211test_quote_java_property " spark.space.3" 1 " \" -Dstraw=berry again\" "
206212test_quote_java_property " spark.space.4" 1 " \" -Dstraw=berry \" quote\" "
207213test_quote_java_property " spark.space.5" 1 " \" -Dstraw=berry \\ backslash\" "
208- test_quote_java_property " spark.space.6" 1 " \" -Dstraw=berry \" quotes\" and \\ backslashes\\ \" "
209- test_quote_java_property " spark.space.7" 3 " \" -Dstraw=berry\" " " \" -Dblue=berry\" " " \" -Dblack=berry\" "
210- test_quote_java_property " spark.space.8" 3 " \" -Dstraw=berry space\" " " \" -Dblue=berry\" " " \" -Dblack=berry\" "
214+ test_quote_java_property " spark.space.6" 1 \
215+ " \" -Dstraw=berry \" quotes\" and \\ backslashes\\ \" "
216+ test_quote_java_property " spark.space.7" 3 \
217+ " \" -Dstraw=berry\" " " \" -Dblue=berry\" " " \" -Dblack=berry\" "
218+ test_quote_java_property " spark.space.8" 3 \
219+ " \" -Dstraw=berry space\" " " \" -Dblue=berry\" " " \" -Dblack=berry\" "
211220test_quote_java_property " spark.space.9" 3 \
212221 " \" -Dstraw=berry space\" " " \" -Dblue=berry \" quotes\"\" " " \" -Dblack=berry \\ backslashes\\ \" "
213222test_quote_java_property " spark.space.10" 3 \
0 commit comments