summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/check_cnp.c5
-rw-r--r--src/test/check_pred.c21
2 files changed, 14 insertions, 12 deletions
diff --git a/src/test/check_cnp.c b/src/test/check_cnp.c
index f01a68c..5a9e720 100644
--- a/src/test/check_cnp.c
+++ b/src/test/check_cnp.c
@@ -54,7 +54,7 @@ print_label6(pair6 label)
add_to_list(rules, rule); \
} while (0)
-#define GRAMMAR 4
+#define GRAMMAR 2
int
main(int UNUSED argc, char ** UNUSED argv)
@@ -183,7 +183,8 @@ main(int UNUSED argc, char ** UNUSED argv)
string = new_utf8("aab", 3);
break;
case 2:
- string = new_utf8("[[[[[[[[[[[[[[[[[[[[[[[++[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]--]]]]]]]]]]]]]]]]]]]]]]]", 204);
+ /* taken from Wikipedia: <https://en.wikipedia.org/wiki/Brainfuck> */
+ string = new_utf8("++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.", 106);
break;
case 3:
string = new_utf8("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", 100);
diff --git a/src/test/check_pred.c b/src/test/check_pred.c
index 2767c45..14081d5 100644
--- a/src/test/check_pred.c
+++ b/src/test/check_pred.c
@@ -90,15 +90,16 @@ main(int UNUSED argc, char ** UNUSED argv)
user_name_s = new_utf8(user_name, 5);
- SAFE_MALLOC(char, raw_name, 7, return 1;);
+ SAFE_MALLOC(char, raw_name, 8, return 1;);
- *(raw_name+0) = 'a';
- *(raw_name+1) = '-';
- *(raw_name+2) = 'z';
- *(raw_name+3) = 'A';
- *(raw_name+4) = '-';
- *(raw_name+5) = 'Z';
- *(raw_name+6) = 0;
+ *(raw_name+0) = '^';
+ *(raw_name+1) = 'a';
+ *(raw_name+2) = '-';
+ *(raw_name+3) = 'z';
+ *(raw_name+4) = 'A';
+ *(raw_name+5) = '-';
+ *(raw_name+6) = 'Z';
+ *(raw_name+7) = 0;
raw_name_s = new_utf8(raw_name, 6);
@@ -111,7 +112,7 @@ main(int UNUSED argc, char ** UNUSED argv)
*(pred_bytes+pred_bytes_len++) = 'A' + i;
if (add_to_list(preds, new_ptd(user_name_s, raw_name_s,
- dfa_from_bytes
+ dfa_from_bytes_neg
(pred_bytes_len, pred_bytes)))) {
fleprintf0("Fail to add a predicate\n");
return 1;
@@ -125,7 +126,7 @@ main(int UNUSED argc, char ** UNUSED argv)
print_grammar(g);
- utf8 *string = new_utf8("awdfsdjbfsjdhxy", 15);
+ utf8 *string = new_utf8("++--__,.(){}><|", 15);
printf("\nPrinting the input...\n%s\n", get_data((str *) string));