From 4c5b387aa9b7c9402d79e7c7b1444b570fae603e Mon Sep 17 00:00:00 2001 From: Adam Samalik Date: Thu, 29 Jun 2023 18:11:01 +0200 Subject: [PATCH] re-import sources as agreed with the maintainer --- .gitignore | 2 +- tests/scripts/run.sh | 26 ++++++++++++++++++++++++++ tests/scripts/test_libvoikko.py | 22 ++++++++++++++++++++++ tests/tests.yml | 12 ++++++++++++ 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 tests/scripts/run.sh create mode 100644 tests/scripts/test_libvoikko.py create mode 100644 tests/tests.yml diff --git a/.gitignore b/.gitignore index b16a973..6851273 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -SOURCES/libvoikko-4.1.1.tar.gz +/libvoikko-3.8.tar.gz /libvoikko-4.1.1.tar.gz diff --git a/tests/scripts/run.sh b/tests/scripts/run.sh new file mode 100644 index 0000000..d449804 --- /dev/null +++ b/tests/scripts/run.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +check_pkg() { + local pkg=$1 + if rpm -q $pkg + then + echo "PASS" + else + echo "FAIL" + fi +} + + +check_pkg "python3-libvoikko" +check_pkg "libvoikko" +check_pkg "malaga-suomi-voikko" + +python3 test_libvoikko.py + +if [ $? == 0 ] +then + echo "PASS" +else + echo "FAIL" +fi + diff --git a/tests/scripts/test_libvoikko.py b/tests/scripts/test_libvoikko.py new file mode 100644 index 0000000..9808456 --- /dev/null +++ b/tests/scripts/test_libvoikko.py @@ -0,0 +1,22 @@ +import sys +import libvoikko + +FAILED_COUNT = 0 + +def spellcheck(word): + v = libvoikko.Voikko('fi') + return v.spell(word) + +if not spellcheck('kisssa'): + print("PASS") +else: + FAILED_COUNT += 1 + print("FAIL") + +if spellcheck('hei'): + print("PASS") +else: + FAILED_COUNT += 1 + print("FAIL") + +sys.exit(FAILED_COUNT) diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..105d519 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,12 @@ +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + required_packages: + - python3-libvoikko + - malaga-suomi-voikko + tests: + - simple: + dir: scripts + run: bash run.sh