aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-08-01 20:09:38 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:08 -0500
commitfac7901dca0b4821582c6062600d37ac987082d9 (patch)
tree177f20f43d11e65857be9a6d71a5e27c370212c5 /test
parentaa96c067439252b1955cfa11e75948d15f1b1656 (diff)
downloadserd-fac7901dca0b4821582c6062600d37ac987082d9.tar.gz
serd-fac7901dca0b4821582c6062600d37ac987082d9.tar.bz2
serd-fac7901dca0b4821582c6062600d37ac987082d9.zip
Collapse input and output options into single flags
Diffstat (limited to 'test')
-rw-r--r--test/meson.build53
-rwxr-xr-xtest/run_suite.py2
-rwxr-xr-xtest/test_base.py2
-rwxr-xr-xtest/test_empty.py2
-rwxr-xr-xtest/test_stdin.py2
5 files changed, 31 insertions, 30 deletions
diff --git a/test/meson.build b/test/meson.build
index 24180efa..84ae7525 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -108,7 +108,7 @@ if get_option('lint')
test(
ttl_file_path.underscorify(),
check_formatting_py,
- args: [files(ttl_file_path), serd_pipe, '-o', 'turtle'],
+ args: [files(ttl_file_path), serd_pipe, '-O', 'turtle'],
suite: 'data',
)
endforeach
@@ -180,22 +180,22 @@ simple_command_tests = {
'bad': [
['-B', 'nonuriorpath'],
['-B'],
+ ['-I', 'turtle'],
+ ['-I', 'unknown'],
+ ['-I'],
+ ['-O', 'unknown'],
+ ['-O'],
['-b', '-1'],
['-b', '1024junk'],
['-b', '9223372036854775807'],
['-b'],
['-c'],
- ['-fi'],
- ['-i', 'turtle'],
- ['-i', 'unknown'],
- ['-i'],
['-k', '-1'],
['-k', '1024junk'],
['-k', '9223372036854775807'],
['-k'],
- ['-o', 'unknown'],
- ['-o'],
['-p'],
+ ['-qi'],
['-r'],
['-s', '<foo> a <Bar> .'],
['-s'],
@@ -395,30 +395,30 @@ test_suites = {
files('w3c/nquads/manifest.ttl'),
ns_w3 + 'NQuadsTests/',
'--',
- '-a',
- ['-i', 'NQuads'],
+ ['-I', 'NQuads'],
+ ['-O', 'ascii'],
],
'ntriples': [
files('w3c/ntriples/manifest.ttl'),
ns_w3 + 'NTriplesTests/',
'--',
- '-a',
- ['-i', 'NTriples'],
+ ['-I', 'NTriples'],
+ ['-O', 'ascii'],
['-k', '1024'],
],
'trig': [
files('w3c/trig/manifest.ttl'),
ns_w3 + 'TriGTests/',
'--',
- '-a',
- ['-i', 'TriG'],
+ ['-I', 'TriG'],
+ ['-O', 'ascii'],
],
'turtle': [
files('w3c/turtle/manifest.ttl'),
ns_w3 + 'TurtleTests/',
'--',
- '-a',
- ['-i', 'Turtle'],
+ ['-I', 'Turtle'],
+ ['-O', 'ascii'],
],
'abbreviate': [
@@ -433,7 +433,7 @@ test_suites = {
files('extra/bad/manifest.ttl'),
ns_serdtest + 'bad/',
'--',
- ['-o', 'turtle'],
+ ['-O', 'turtle'],
],
'big': [
files('extra/big/manifest.ttl'),
@@ -443,41 +443,42 @@ test_suites = {
files('extra/good/manifest.ttl'),
ns_serdtest + 'good/',
'--',
- '-a',
['-b', '1'],
+ ['-O', 'ascii'],
],
'canon': [
files('extra/canon/manifest.ttl'),
ns_serdtest + 'canon/',
'--',
'-C',
- '-a',
+ ['-O', 'ascii'],
],
'fast': [
files('extra/perfect/manifest.ttl'),
ns_serdtest + 'perfect/',
'--',
- '-f',
+ ['-I', 'verbatim'],
+ ['-O', 'verbatim'],
],
'full': [
files('extra/full/manifest.ttl'),
ns_serdtest + 'full/',
'--',
- '-f',
+ ['-O', 'expanded'],
],
'good': [
files('extra/good/manifest.ttl'),
ns_serdtest + 'good/',
'--',
- '-a',
+ ['-O', 'ascii'],
],
'lax_lax': [
'--lax',
files('extra/lax/manifest.ttl'),
ns_serdtest + 'lax/',
'--',
- '-a',
- '-l',
+ ['-I', 'lax'],
+ ['-O', 'ascii'],
],
'lax_strict': [
files('extra/lax/manifest.ttl'),
@@ -487,7 +488,7 @@ test_suites = {
files('extra/pattern/manifest.ttl'),
ns_serdtest + 'pattern/',
'--',
- '-x',
+ ['-I', 'variables'],
],
'perfect_forward': [
files('extra/perfect/manifest.ttl'),
@@ -519,7 +520,7 @@ test_suites = {
files('extra/qualify/manifest.ttl'),
ns_serdtest + 'qualify/',
'--',
- ['-i', 'turtle'], # Just for coverage
+ ['-I', 'turtle'], # Just for coverage
],
'root': [
files('extra/root/manifest.ttl'),
@@ -531,7 +532,7 @@ test_suites = {
files('extra/terse/manifest.ttl'),
ns_serdtest + 'terse/',
'--',
- '-t',
+ ['-O', 'terse'],
],
}
diff --git a/test/run_suite.py b/test/run_suite.py
index cee9d88e..16e527af 100755
--- a/test/run_suite.py
+++ b/test/run_suite.py
@@ -41,7 +41,7 @@ def run_eval_test(command, in_path, good_path, out_path):
"""Run a positive eval test and return whether the output matches."""
syntax = util.syntax_from_path(out_path)
- command = command + ["-o", syntax, "-w", out_path, in_path]
+ command = command + ["-O", syntax, "-w", out_path, in_path]
subprocess.check_call(command, encoding="utf-8")
with open(good_path, "r", encoding="utf-8") as good:
diff --git a/test/test_base.py b/test/test_base.py
index b63bb135..cb696d2f 100755
--- a/test/test_base.py
+++ b/test/test_base.py
@@ -10,7 +10,7 @@
import serd_test_util as util
args = util.wrapper_args(__doc__)
-command = [args.tool, "-B", "http://example.org", "-i", "turtle", "-"]
+command = [args.tool, "-B", "http://example.org", "-I", "turtle", "-"]
IN_DOC = "<s> <p> <o> ."
OUT_DOC = "<{0}s> <{0}p> <{0}o> .".format("http://example.org/")
diff --git a/test/test_empty.py b/test/test_empty.py
index 0ee641d5..85c603fe 100755
--- a/test/test_empty.py
+++ b/test/test_empty.py
@@ -14,7 +14,7 @@ import tempfile
import serd_test_util as util
args = util.wrapper_args(__doc__, True)
-command = shlex.split(args.wrapper) + [args.tool, "-o", "empty", args.input]
+command = shlex.split(args.wrapper) + [args.tool, "-O", "empty", args.input]
with tempfile.TemporaryFile() as out:
proc = subprocess.run(command, check=False, stdout=out)
diff --git a/test/test_stdin.py b/test/test_stdin.py
index 9ffd19ff..790d34ce 100755
--- a/test/test_stdin.py
+++ b/test/test_stdin.py
@@ -10,7 +10,7 @@
import serd_test_util as util
args = util.wrapper_args(__doc__)
-command = [args.tool, "-i", "ntriples", "-B", "http://example.org", "-"]
+command = [args.tool, "-I", "ntriples", "-B", "http://example.org", "-"]
DOC = "<{0}s> <{0}p> <{0}o> .".format("http://example.org/")