diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2023-06-30 02:37:27 +0200 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2023-06-30 03:32:14 +0200 |
commit | e928ce51bd8c26742abfd537b054483a18a9689c (patch) | |
tree | ad3bfcf7b509dbde4681c011237c8bd23ee8583f /test/py | |
parent | fix function names in error messages (diff) | |
download | cimple-e928ce51bd8c26742abfd537b054483a18a9689c.tar.gz cimple-e928ce51bd8c26742abfd537b054483a18a9689c.zip |
show git hash with --version
Also, use cmake's configure_file to build string constants in.
Diffstat (limited to '')
-rw-r--r-- | test/py/test_basic.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/py/test_basic.py b/test/py/test_basic.py index c34f9ef..ab062e5 100644 --- a/test/py/test_basic.py +++ b/test/py/test_basic.py @@ -3,11 +3,15 @@ # For details, see https://github.com/egor-tensin/cimple. # Distributed under the MIT License. +import re + def test_server_and_workers_run(server_and_workers): pass def test_client_version(client, version): - output = client.run('--version') - assert output.endswith(version + '\n') + output = client.run('--version').removesuffix('\n') + match = re.match(r'^cimple-client v(\d+\.\d+\.\d+) \([0-9a-f]{40,}\)$', output) + assert match, f'Invalid --version output: {output}' + assert match.group(1) == version |