From 3cc5a4fcaea8f1e2fd47c53135b53f8edcb8619d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 5 Apr 2023 07:01:18 -0400 Subject: Factor out and rewrite command-line interface --- test/meson.build | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) (limited to 'test/meson.build') diff --git a/test/meson.build b/test/meson.build index 0e887ccb..43fc7211 100644 --- a/test/meson.build +++ b/test/meson.build @@ -181,32 +181,27 @@ simple_command_tests = { 'bad': [ ['-B', 'nonuriorpath'], ['-B'], - ['-I', 'turtle'], ['-I', 'unknown'], ['-I'], ['-O', 'unknown'], ['-O'], + ['-R'], ['-b', '-1'], ['-b', '1024junk'], - ['-b', '9223372036854775807'], ['-b'], - ['-k', '-1'], - ['-k', '1024junk'], ['-k', '9223372036854775807'], ['-k'], ['-qi'], - ['-r'], ['-s', ' a .'], ['-s'], - ['-w'], ['-z'], ], 'good': [ ['--help'], ['--version'], + ['-V'], ['-h'], ['-k', '512', '-s', 'a .'], - ['-v'], ], }, } @@ -236,10 +231,16 @@ if is_variable('serd_pipe') endforeach endforeach - test('none', serd_pipe, env: test_env, should_fail: true, suite: cmd_suite) - # Base URI options + test( + 'bad_rebase', + serd_pipe, + args: ['-B', 'rebase', serd_ttl], + env: test_env, + should_fail: true, + suite: cmd_suite, + ) test( 'base', files('test_base.py'), @@ -247,6 +248,13 @@ if is_variable('serd_pipe') env: test_env, suite: cmd_suite, ) + test( + 'dir_base', + serd_pipe, + args: ['-B', serd_src_root / '', serd_ttl], + env: test_env, + suite: cmd_suite, + ) # Log @@ -286,6 +294,21 @@ if is_variable('serd_pipe') input_suite = ['tools', 'pipe', 'input'] + good_input_tests = { + 'unknown_extension': [files('trig_unknown_extension.n3')], + 'no_extension': [files('trig_no_extension')], + } + + foreach name, args : good_input_tests + test( + name, + serd_pipe, + args: args, + env: test_env, + suite: input_suite, + ) + endforeach + bad_input_tests = { 'string': ['-s', ' a .'], 'no_such_file': ['no_such_file'], @@ -513,7 +536,7 @@ test_suites = { files('extra/root/manifest.ttl'), ns_serdtest + 'root/', '--', - ['-r', 'http://example.org/top/root/'], + ['-R', 'http://example.org/top/root/'], ], 'terse': [ files('extra/terse/manifest.ttl'), -- cgit v1.2.1