summaryrefslogtreecommitdiff
path: root/test/cmd/setexpr.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/cmd/setexpr.c')
-rw-r--r--test/cmd/setexpr.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/cmd/setexpr.c b/test/cmd/setexpr.c
index 650fbc8ebee..5e9b577fe36 100644
--- a/test/cmd/setexpr.c
+++ b/test/cmd/setexpr.c
@@ -303,7 +303,8 @@ static int setexpr_test_str(struct unit_test_state *uts)
memset(buf, '\xff', BUF_SIZE);
ut_assertok(env_set("fred", "x"));
- ut_asserteq(1, run_command("setexpr.s fred 0", 0));
+ ut_asserteq(0, run_command("setexpr.s fred 0", 0));
+ ut_asserteq_str("0", env_get("fred"));
strcpy(buf, "hello");
ut_assertok(env_set("fred", "12345"));
@@ -321,6 +322,10 @@ static int setexpr_test_str_oper(struct unit_test_state *uts)
{
char *buf;
+ /* Test concatenation of strings */
+ ut_assertok(run_command("setexpr.s fred '1' + '3'", 0));
+ ut_asserteq_str("13", env_get("fred"));
+
buf = map_sysmem(0, BUF_SIZE);
memset(buf, '\xff', BUF_SIZE);
strcpy(buf, "hello");