You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
407 B
16 lines
407 B
#include "escape.h"
|
|
|
|
#include <assert.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
int main(void) {
|
|
assert(strcmp("aa", shellEscape("aa")) == 0);
|
|
assert(strcmp("'aa bb'", shellEscape("aa bb")) == 0);
|
|
assert(strcmp("'a(b)'", shellEscape("a(b)")) == 0);
|
|
assert(strcmp("'aa && bb'", shellEscape("aa && bb")) == 0);
|
|
assert(strcmp("'echo aa '\"'\"'s'\"'\"''", shellEscape("echo aa 's'")) == 0);
|
|
return 0;
|
|
}
|
|
|