summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tests/eolian/data/class_simple.eo2
-rw-r--r--src/tests/eolian/eolian_parsing.c17
2 files changed, 19 insertions, 0 deletions
diff --git a/src/tests/eolian/data/class_simple.eo b/src/tests/eolian/data/class_simple.eo
index c6aa05b00b..8717145806 100644
--- a/src/tests/eolian/data/class_simple.eo
+++ b/src/tests/eolian/data/class_simple.eo
@@ -1,3 +1,5 @@
1#version 1
2
1const Foo: int = 5; [[doc for constant]] 3const Foo: int = 5; [[doc for constant]]
2 4
3var Bar: float = 10.3f; [[doc for global]] 5var Bar: float = 10.3f; [[doc for global]]
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c
index 2fbb1b52b0..c8f4383113 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -1587,6 +1587,22 @@ EFL_START_TEST(eolian_class_unimpl)
1587} 1587}
1588EFL_END_TEST 1588EFL_END_TEST
1589 1589
1590EFL_START_TEST(eolian_version)
1591{
1592 Eolian_State *eos = eolian_state_new();
1593 const Eolian_Unit *u1, *u2;
1594
1595 fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
1596
1597 fail_if(!(u1 = eolian_state_file_parse(eos, "class_simple.eo")));
1598 fail_if(!(u2 = eolian_state_file_parse(eos, "base.eo")));
1599 fail_if(eolian_unit_version_get(u1) != 1);
1600 fail_if(eolian_unit_version_get(u2) != 1);
1601
1602 eolian_state_free(eos);
1603}
1604EFL_END_TEST
1605
1590void eolian_parsing_test(TCase *tc) 1606void eolian_parsing_test(TCase *tc)
1591{ 1607{
1592 tcase_add_test(tc, eolian_simple_parsing); 1608 tcase_add_test(tc, eolian_simple_parsing);
@@ -1612,4 +1628,5 @@ void eolian_parsing_test(TCase *tc)
1612 tcase_add_test(tc, eolian_mixins_require); 1628 tcase_add_test(tc, eolian_mixins_require);
1613 tcase_add_test(tc, eolian_class_requires_classes); 1629 tcase_add_test(tc, eolian_class_requires_classes);
1614 tcase_add_test(tc, eolian_class_unimpl); 1630 tcase_add_test(tc, eolian_class_unimpl);
1631 tcase_add_test(tc, eolian_version);
1615} 1632}