// SPDX-License-Identifier: GPL-2.0+
/*
 * Tests for echo command
 *
 * Copyright 2020, Heinrich Schuchadt <xypron.glpk@gmx.de>
 */

#include <command.h>
#include <asm/global_data.h>
#include <display_options.h>
#include <test/lib.h>
#include <test/test.h>
#include <test/ut.h>

DECLARE_GLOBAL_DATA_PTR;

struct test_data {
	char *cmd;
	char *expected;
};

static struct test_data echo_data[] = {
	{"echo 1 2 3",
	 "1 2 3"},
	/* Test new line handling */
	{"echo -n 1 2 3; echo a b c",
	 "1 2 3a b c"},
	/*
	 * Test handling of environment variables.
	 *
	 * j, q, x are among the least frequent letters in English.
	 * Hence no collision for the variable name jQx is expected.
	 */
	{"setenv jQx X; echo \"a)\" ${jQx} 'b)' '${jQx}' c) ${jQx}; setenv jQx",
	 "a) X b) ${jQx} c) X"},
	/* Test shell variable assignments without substitutions */
	{"foo=bar echo baz", "baz"},
	/* Test handling of shell variables. */
	{"setenv jQx; for jQx in 1 2 3; do echo -n \"${jQx}, \"; done; echo;",
	 "1, 2, 3, "},
};

static int lib_test_hush_echo(struct unit_test_state *uts)
{
	int i;

	for (i = 0; i < ARRAY_SIZE(echo_data); ++i) {
		ut_assertok(run_command(echo_data[i].cmd, 0));
		console_record_readline(uts->actual_str,
					sizeof(uts->actual_str));
		ut_asserteq_str(echo_data[i].expected, uts->actual_str);
		ut_assert_console_end();
	}
	return 0;
}
LIB_TEST(lib_test_hush_echo, UTF_CONSOLE);
