summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-01-18 11:38:25 -0500
committerTom Rini <trini@konsulko.com>2024-01-18 11:38:25 -0500
commitf7cca7ccc5117eaafcc2bde91ad1bed6fee7cfc3 (patch)
treeae6232390965823ac7627df5f7ebe634c09ac2c8 /test
parent3c3a73424e6d6f7b86b9347da7c0e78379933319 (diff)
downloadu-boot-f7cca7ccc5117eaafcc2bde91ad1bed6fee7cfc3.tar.gz
u-boot-f7cca7ccc5117eaafcc2bde91ad1bed6fee7cfc3.tar.bz2
u-boot-f7cca7ccc5117eaafcc2bde91ad1bed6fee7cfc3.zip
Revert "test: hush: dollar: fix bugous behavior"
What we were doing here amounts to simplifying the code for the new hush parser, and the workarounds are required when using the old one. As we have returned to having the old parser be default for now, we must undo this so that the test passes again. This reverts commit 6c2f753f4ad3dcee60190949d1286736a6d51d17. Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'test')
-rw-r--r--test/hush/dollar.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/test/hush/dollar.c b/test/hush/dollar.c
index 68d0874d90..4caa07c192 100644
--- a/test/hush/dollar.c
+++ b/test/hush/dollar.c
@@ -53,12 +53,29 @@ 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();
- ut_assert_console_end();
+
+ 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_asserteq(1, run_command("dollar_foo=bar quux\"", 0));
- /* Next line contains error message */
+ /* Two next lines contain error message */
ut_assert_skipline();
- ut_assert_console_end();
+ 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();
+ }
ut_assertok(run_command("dollar_foo='bar \"quux'", 0));