summaryrefslogtreecommitdiff
path: root/codegen/test_header.py
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2023-10-22 18:42:58 +0300
committeraqua <aqua@iserlohn-fortress.net>2023-10-22 18:42:58 +0300
commitfbe4a5eeab2107dfe03fc097bc1f9627b222adbd (patch)
tree11dd6b18e324721b1b3f23ed3617ac6922774ea7 /codegen/test_header.py
downloadcodegen-fbe4a5eeab2107dfe03fc097bc1f9627b222adbd.tar.xz
Initial commitHEADmaster
Diffstat (limited to 'codegen/test_header.py')
-rw-r--r--codegen/test_header.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/codegen/test_header.py b/codegen/test_header.py
new file mode 100644
index 0000000..233845e
--- /dev/null
+++ b/codegen/test_header.py
@@ -0,0 +1,17 @@
+import unittest
+from .header import Header
+
+class HeaderUnittests(unittest.TestCase):
+ def test_c_header_guard(self):
+ hdr = Header('stdio.yaml')
+ self.assertEqual('STDIO_H', hdr.header_guard())
+
+ hdr = Header('LinkedListAllocator.yaml')
+ self.assertEqual('LINKED_LIST_ALLOCATOR_H', hdr.header_guard())
+
+ def test_mock_header_guard(self):
+ hdr = Header('stdio.yaml')
+ self.assertEqual('MOCK_STDIO_HH', hdr.header_guard(mock=True))
+
+ hdr = Header('LinkedListAllocator.yaml')
+ self.assertEqual('MOCK_LINKED_LIST_ALLOCATOR_HH', hdr.header_guard(mock=True))