welp. and i'm done lol
This commit is contained in:
@@ -7,5 +7,10 @@ int main(int argc, char **argv){
|
|||||||
PRINT_ERROR("%s obviously needs arguments to work…", NAME);
|
PRINT_ERROR("%s obviously needs arguments to work…", NAME);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<argc; i++){
|
||||||
|
char *arg = argv[i][0] == '\0' ? "''" : argv[i];
|
||||||
|
printf ( "@%d\t%s\n", i, arg);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,5 +11,16 @@ setup(){
|
|||||||
|
|
||||||
@test "no args? you fail." {
|
@test "no args? you fail." {
|
||||||
run args
|
run args
|
||||||
|
assert_output --partial "args obviously needs arguments to work…"
|
||||||
assert_failure
|
assert_failure
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "one arg" {
|
||||||
|
run args one
|
||||||
|
assert_output --partial "@1"$'\t'"one"
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "represent empty string" {
|
||||||
|
run args ''
|
||||||
|
assert_output --partial "@1"$'\t'"''"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user