Skip to content

Commit 35d6141

Browse files
author
Heitor Danilo
committed
add: AST tests
1 parent e2417cc commit 35d6141

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

src/main_test.c

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
#include <stdio.h>
22

3+
#include <ast/ast_test.h>
34
#include <token/token_test.h>
45

6+
void print_test_group(char* str) {
7+
printf("\n\x1b[33m%s:\x1b[0m\n", str);
8+
}
9+
510
int main() {
6-
test_number_assignment();
7-
test_bool_assignment();
8-
test_delimiters();
9-
test_single_symbol();
10-
test_compound_symbol();
11-
test_semicolon_symbol_independence();
11+
print_test_group("TOKEN");
12+
test_should_pass_if_number_assignment_is_equal_to_expected();
13+
test_should_pass_if_bool_assignments_are_equal_to_expected();
14+
test_should_pass_if_delimiters_are_equal_to_expected();
15+
test_should_pass_if_single_symbols_are_equal_to_expected();
16+
test_should_pass_if_compound_symbols_are_equal_to_expected();
17+
test_should_pass_if_semicolon_assingment_are_equal_to_expected();
18+
19+
print_test_group("AST");
20+
test_should_pass_if_return_statement_to_string_is_equal_to_expected();
21+
test_should_pass_if_var_statement_to_string_is_equal_to_expected();
22+
test_should_pass_if_mutable_var_statement_to_string_is_equal_to_expected();
23+
test_should_pass_if_program_to_string_is_equal_to_expected();
1224

1325
printf("\n\x1b[32mAll tests pass.\x1b[0m\n");
1426

0 commit comments

Comments
 (0)