Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test<dot_test>: adding new test for dot #98

Merged
merged 1 commit into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/execute/utils/builtin.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ int check_file(struct ast_node *node, char *first_arg, char *path)
free(first_arg);
node->children[0]->value = path;
fclose(file);
return 1;
return 126;
}
fclose(file);

Expand Down Expand Up @@ -332,9 +332,12 @@ int dot_fun(struct ast_node *node)
{
return return_val;
}
if (doted && check_file(node, first_arg, path) == 1)

if (doted)
{
return 1;
int r = check_file(node, first_arg, path);
if (r != 0)
return r;
}
if (!doted)
free(path);
Expand Down
1 change: 1 addition & 0 deletions tests/builtin/cd/testsuite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ run_test cd_simple_test7.test

run_test cd_complex_test1.test
run_test cd_complex_test2.test
run_test cd_complex_test3.test

run_test cd_error_test1.test
run_test cd_error_test2.test
1 change: 1 addition & 0 deletions tests/builtin/dot/dot_complex_test4.test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a=test.sh;b=lpdl; . ../dot/$a; ./$a; . $a; . ../dot/$b $a; . ../dot/$a $b
7 changes: 6 additions & 1 deletion tests/builtin/dot/testsuite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@ run_test dot_simple_test2.test
run_test dot_simple_test3.test
run_test dot_simple_test4.test
run_test dot_simple_test5.test

run_test dot_complex_test1.test
run_test dot_complex_test2.test
run_test dot_complex_test2.test
run_test dot_complex_test3.test
run_test dot_complex_test4.test

run_test dot_error_test1.test
Loading