feat(expansion): special_variable_with_braces test
This commit is contained in:
parent
df7cc02eb9
commit
a16712e802
1 changed files with 11 additions and 0 deletions
|
|
@ -62,6 +62,17 @@ Test(parse_var_name, special_variable)
|
||||||
free(extracted_var);
|
free(extracted_var);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Test(parse_var_name, special_variable_with_braces)
|
||||||
|
{
|
||||||
|
char *input = "${1}";
|
||||||
|
char *extracted_var = NULL;
|
||||||
|
size_t r = parse_var_name(input, &extracted_var);
|
||||||
|
|
||||||
|
cr_expect(r == 4);
|
||||||
|
cr_expect_str_eq(extracted_var, "1");
|
||||||
|
free(extracted_var);
|
||||||
|
}
|
||||||
|
|
||||||
Test(parse_var_name, incomplete_braces)
|
Test(parse_var_name, incomplete_braces)
|
||||||
{
|
{
|
||||||
char *input = "${MY_VAR";
|
char *input = "${MY_VAR";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue