From 09f7d8845af39c1e52bceb5e6165d7ccc37d04ed Mon Sep 17 00:00:00 2001 From: graphemecluster Date: Thu, 18 Jul 2024 14:10:44 +0800 Subject: [PATCH] Test 0.3.0 --- .github/workflows/python-test.yml | 14 +++++++++++++- tests/test_tojyutping.py | 5 ----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index e4e2cf9..801cbf1 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -3,7 +3,7 @@ name: Run Python Unit Test on: workflow_call: push: - branches: [main] + branches: [test-prev] jobs: test: @@ -14,8 +14,20 @@ jobs: version: ['3.8', '3.10', '3.x'] runs-on: ${{ matrix.os }} steps: + - name: Checkout 0.3.0 + uses: actions/checkout@v4 + with: + ref: '0.3.0' + fetch-depth: 0 + fetch-tags: true - name: Checkout latest commit uses: actions/checkout@v4 + with: + path: latest + - shell: bash + run: | + cp -r latest/tests tests/ + rm -rf latest - name: Set up Python uses: actions/setup-python@v5 with: diff --git a/tests/test_tojyutping.py b/tests/test_tojyutping.py index 3b4c100..a7c15f3 100644 --- a/tests/test_tojyutping.py +++ b/tests/test_tojyutping.py @@ -55,11 +55,6 @@ def test_get_ipa_candidates(self): expected = [('咁', ['kɐm˧', 'kɐm˧˥', 'kɐm˥', 'kɐm˨˩']), ('啱', ['ŋaːm˥', 'aːm˥', 'ɐm˥', 'ŋɐm˥']), ('老', ['lou̯˩˧', 'lou̯˧˥']), ('世', ['sɐi̯˧', 'sɐi̯˧˥']), ('要', ['jiːu̯˥', 'jiːu̯˧', 'jiːu̯˧˥']), ('求', ['kʰɐu̯˨˩']), ('佢', ['kʰɵy̑˩˧', 'hɵy̑˩˧']), ('等', ['tɐŋ˧˥']), ('陣', ['t͡sɐn˨', 't͡sɐn˧˥']), ('要', ['jiːu̯˧', 'jiːu̯˧˥', 'jiːu̯˥']), ('開', ['hɔːi̯˥']), ('會', ['wuːi̯˧˥', 'wuːi̯˩˧', 'wuːi̯˨', 'wuːi̯˧', 'kʰuːi̯˧˥', 'kʰuːi̯˧', 'kʷʰuːi̯˧˥']), (',', []), ('剩', ['t͡seŋ˨', 'seŋ˨']), ('低', ['tɐi̯˥']), ('嘅', ['kɛː˧', 'kɛː˧˥', 'kʰɔːi̯˧˥', 'kʰɔːi̯˧']), ('嘢', ['jɛː˩˧', 'ɛː˩˧']), ('我', ['ŋɔː˩˧', 'ɔː˩˧']), ('會', ['wuːi̯˩˧', 'wuːi̯˨', 'wuːi̯˧˥', 'wuːi̯˧', 'kʰuːi̯˧˥', 'kʰuːi̯˧', 'kʷʰuːi̯˧˥']), ('搞', ['kaːu̯˧˥']), ('掂', ['tiːm˨', 'tiːm˧', 'tiːm˥']), ('㗎', ['kaː˧', 'kɐ˧', 'kaː˧˥', 'kaː˥', 'kaː˨˩']), ('喇', ['laː˧', 'laː˥', 'laːk̚˧', 'laː˩˧', 'laːt̚˧']), ('。', [])] self.assertEqual(result, expected) - def test_g2p(self): - result = ToJyutping.g2p(self.test_string) - expected = [(9, 32, 89), (11, 23, 87), (8, 58, 91), (18, 30, 89), (19, 49, 87), (10, 31, 90), (10, 79, 91), (5, 34, 88), (16, 33, 92), (19, 49, 89), (15, 57, 87), (14, 66, 88), (16, 52, 92), (5, 30, 87), (9, 38, 89), (19, 38, 91), (11, 56, 91), (14, 66, 91), (9, 22, 88), (5, 50, 92), (9, 20, 89), (8, 20, 89)] - self.assertEqual(result, expected) - def test_jyutping2ipa(self): result = ToJyutping.jyutping2ipa("cin1 ngaa5") expected = "t͡sʰiːn˥.ŋaː˩˧"