Check version of KorAP-Tokenizer when requested

Change-Id: Iea411e514ba3a3eb8eb93a252c9652f38095a98d
diff --git a/t/script.t b/t/script.t
index f311db0..51f5751 100644
--- a/t/script.t
+++ b/t/script.t
@@ -747,5 +747,31 @@
   ->stderr_like(qr!Debugging is activated!);
 };
 
+subtest 'Required version testing' => sub {
+  test_tei2korapxml(
+    tmp => 'script_out',
+    file => $file,
+    param => '-rv=2.2.2'
+  )->stderr_like(qr!^Required version 2\.2\.2 mismatches version!);
+
+  test_tei2korapxml(
+    tmp => 'script_out',
+    file => $file,
+    param => '--required-version=2.2'
+  )->stderr_like(qr!^Required version 2\.2 mismatches version!);
+
+  test_tei2korapxml(
+    tmp => 'script_out',
+    file => $file,
+    param => '-rv=' . $KorAP::XML::TEI::Tokenizer::KorAP::VERSION
+  )->stderr_like(qr!GOE_AGA\.00000!);
+
+  test_tei2korapxml(
+    tmp => 'script_out',
+    file => $file,
+    param => '-rv=   "  ' . $KorAP::XML::TEI::Tokenizer::KorAP::VERSION . '  "'
+  )->stderr_like(qr!GOE_AGA\.00000!);
+};
+
 
 done_testing;