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

#include <common.h>
#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 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) {
		console_record_reset_enable();
		ut_assertok(run_command(echo_data[i].cmd, 0));
		gd->flags &= ~GD_FLG_RECORD;
		console_record_readline(uts->actual_str,
					sizeof(uts->actual_str));
		ut_asserteq_str(echo_data[i].expected, uts->actual_str);
		ut_assertok(ut_check_console_end(uts));
	}
	return 0;
}

LIB_TEST(lib_test_hush_echo, 0);
