Skip to content

Instantly share code, notes, and snippets.

@jonm
Created November 8, 2015 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonm/ba4a7cbd77b6fa4e451e to your computer and use it in GitHub Desktop.
Save jonm/ba4a7cbd77b6fa4e451e to your computer and use it in GitHub Desktop.
Test(act_wizard, dsearch_simple_arg) {
char arg[255], dst[255];
sprintf(arg, "Someone appears!");
dsearch(arg, dst);
cr_assert_str_eq(arg, "Someone appears!");
}
Test(act_wizard, dsearch_simple_tilde_arg) {
char arg[255], dst[255];
sprintf(arg, "Someone ~ appears!");
dsearch(arg, dst);
cr_assert_str_eq(arg, "Someone appears!");
}
Test(act_wizard, dsearch_tilde_at_end_arg) {
char arg[255], dst[255];
sprintf(arg, "Someone appears!~");
dsearch(arg, dst);
cr_assert_str_eq(arg, "Someone appears!");
}
Test(act_wizard, dsearch_tilde_N_simple_arg) {
char arg[255], dst[255];
sprintf(arg, "Someone ~N appears!");
dsearch(arg, dst);
cr_assert_str_eq(arg, "Someone $n appears!");
}
Test(act_wizard, dsearch_tilde_H_simple_arg) {
char arg[255], dst[255];
sprintf(arg, "Someone ~H appears!");
dsearch(arg, dst);
cr_assert_str_eq(arg, "Someone $s appears!");
}
Test(act_wizard, dsearch_double_tilde_arg) {
char arg[255], dst[255];
sprintf(arg, "Someone ~~ appears!");
dsearch(arg, dst);
cr_assert_str_eq(arg, "Someone appears!");
}
Test(act_wizard, dsearch_double_substitution_arg) {
char arg[255], dst[255];
sprintf(arg, "Someone ~N~N appears!");
dsearch(arg, dst);
cr_assert_str_eq(arg, "Someone $n$n appears!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment