summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2024-09-13 13:44:00 -0600
committerTom Rini <[email protected]>2024-09-13 13:44:00 -0600
commit979207ed6bac1b148802abb85750fc5e9cea223e (patch)
tree9d2f787ea128052c41be3b97e1486c0f87ffd758 /test
parent35394e1ea77ba0ad971d9115bd965a2403c0e031 (diff)
parent874be948de3f6e882ddccd38c7adc66fa773d69f (diff)
Merge patch series "Bump new hush commits and fix old hush test behavior"
Francis Laniel <[email protected]> says: Hi! With this series, I bumped the new hush to get the latest commits from upstream. Also, I added back a reverted commit which goal was to fix a bad behavior in old hush test. I had to tweak a bit this commit, but everything worked both locally and in the CI.
Diffstat (limited to 'test')
-rw-r--r--test/hush/dollar.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/test/hush/dollar.c b/test/hush/dollar.c
index 91b097017c2..077dcd62c0e 100644
--- a/test/hush/dollar.c
+++ b/test/hush/dollar.c
@@ -52,29 +52,22 @@ static int hush_test_simple_dollar(struct unit_test_state *uts)
ut_asserteq(1, run_command("dollar_foo='bar quux", 0));
/* Next line contains error message */
ut_assert_skipline();
-
- if (gd->flags & GD_FLG_HUSH_MODERN_PARSER) {
- /*
- * For some strange reasons, the console is not empty after
- * running above command.
- * So, we reset it to not have side effects for other tests.
- */
- console_record_reset_enable();
- } else if (gd->flags & GD_FLG_HUSH_OLD_PARSER) {
- ut_assert_console_end();
- }
+ ut_assert_console_end();
ut_asserteq(1, run_command("dollar_foo=bar quux\"", 0));
- /* Two next lines contain error message */
- ut_assert_skipline();
+ /* Next line contains error message */
ut_assert_skipline();
-
- if (gd->flags & GD_FLG_HUSH_MODERN_PARSER) {
- /* See above comments. */
- console_record_reset_enable();
- } else if (gd->flags & GD_FLG_HUSH_OLD_PARSER) {
- ut_assert_console_end();
+ /*
+ * Old parser prints the error message on two lines:
+ * Unknown command 'quux
+ * ' - try 'help'
+ * While the new only prints it on one:
+ * syntax error: unterminated \"
+ */
+ if (gd->flags & GD_FLG_HUSH_OLD_PARSER) {
+ ut_assert_skipline();
}
+ ut_assert_console_end();
ut_assertok(run_command("dollar_foo='bar \"quux'", 0));