summaryrefslogtreecommitdiff
path: root/test/scope_test.c
diff options
context:
space:
mode:
authorJohnny Richard <johnny@johnnyrichard.com>2023-04-30 01:48:18 +0200
committerJohnny Richard <johnny@johnnyrichard.com>2023-04-30 01:55:29 +0200
commitef07fab261cce781ca750c1288574d4001f14bcf (patch)
tree9b4da44aee7cc64cec448adeee31b38e12d29e6d /test/scope_test.c
parent88a08db927629032d6d4c662e00f0dce2c112ce4 (diff)
parser: Registry identifiers on scope
We are parsing variables/functions and checking if they are defined on scope. Otherwise we fail the parsing with a nice message. Signed-off-by: Johnny Richard <johnny@johnnyrichard.com> Co-authored-by: Carlos Maniero <carlosmaniero@gmail.com>
Diffstat (limited to 'test/scope_test.c')
-rw-r--r--test/scope_test.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/scope_test.c b/test/scope_test.c
index b8ee30e..c71a38f 100644
--- a/test/scope_test.c
+++ b/test/scope_test.c
@@ -31,24 +31,24 @@ test_scope(const MunitParameter params[], void *user_data_or_fixture)
scope_t *scope = scope_new();
- assert_null(scope_get(scope, &first_id));
- assert_null(scope_get(scope, &second_id));
+ assert_null(scope_get(scope, first_id.name));
+ assert_null(scope_get(scope, second_id.name));
scope_push(scope, &first_id, &first_id_node_1);
scope_push(scope, &second_id, &second_id_node);
- assert_ptr_equal((void *)scope_get(scope, &first_id), (void *)&first_id_node_1);
- assert_ptr_equal((void *)scope_get(scope, &second_id), (void *)&second_id_node);
+ assert_ptr_equal((void *)scope_get(scope, first_id.name), (void *)&first_id_node_1);
+ assert_ptr_equal((void *)scope_get(scope, second_id.name), (void *)&second_id_node);
scope_enter(scope);
scope_push(scope, &first_id, &first_id_node_2);
- assert_ptr_equal((void *)scope_get(scope, &first_id), (void *)&first_id_node_2);
- assert_ptr_equal((void *)scope_get(scope, &second_id), (void *)&second_id_node);
+ assert_ptr_equal((void *)scope_get(scope, first_id.name), (void *)&first_id_node_2);
+ assert_ptr_equal((void *)scope_get(scope, second_id.name), (void *)&second_id_node);
scope_leave(scope);
- assert_ptr_equal((void *)scope_get(scope, &first_id), (void *)&first_id_node_1);
+ assert_ptr_equal((void *)scope_get(scope, first_id.name), (void *)&first_id_node_1);
scope_destroy(scope);