From f0778bc3f37eea1838cb20b8ade2c1fbdda431e8 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Tue, 14 Jun 2022 13:02:13 +0800 Subject: [PATCH] add simple CI test --- tests/parse/test.py | 16 ++++++++++++++++ tests/tests.yml | 13 +++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 tests/parse/test.py create mode 100644 tests/tests.yml diff --git a/tests/parse/test.py b/tests/parse/test.py new file mode 100644 index 0000000..fa27bb5 --- /dev/null +++ b/tests/parse/test.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 + +codepoints = 0 + +file = '/usr/share/unicode/ucd/UnicodeData.txt' + +with open(file, mode='rt', encoding='utf-8') as unicode_data: + for line in unicode_data.readlines(): + codepoint_string, name, category = line.split(';')[:3] + codepoint = int(codepoint_string, 16) + char = chr(codepoint) + codepoints = codepoints + 1 + +print(codepoints) +# Unicode 14 has 34626 +assert(codepoints > 34000) diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..1a3ca0e --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,13 @@ +--- +- hosts: localhost + tags: + - classic + roles: + - role: standard-test-basic + required_packages: + - unicode-ucd + - python3 + tests: + - parse: + run: python3 test.py +...