-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_main.c
35 lines (32 loc) · 1019 Bytes
/
test_main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "anagrammes.h"
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[]) {
char str1[] = "hello";
char str2[] = "ehlol";
bool is_ana = string_are_anagrams(str1, str2);
printf("%d\n", is_ana);
struct word_array *test = malloc(sizeof(struct word_array));
word_array_create(test);
word_array_add(test, str1);
word_array_add(test, str2);
word_array_add(test, string_duplicate(str1));
// // test pour voir si le array_grow marche bien
// for (size_t i = 0; i < 15; i++) {
// word_array_add(test, str1);
// }
string_sort_letters(*test->data);
word_array_print(test);
struct wildcard *joker = malloc(sizeof(struct wildcard));
wildcard_create(joker);
wildcard_search(joker, "ab*c*d");
printf("\n%zu\n", joker->count);
for (size_t i = 0; i < joker->count; i++) {
printf("%zu\n", joker->index[i]);
}
word_array_destroy(test);
return 0;
}