diff options
Diffstat (limited to 'tests/tmain.nim')
-rw-r--r-- | tests/tmain.nim | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/tests/tmain.nim b/tests/tmain.nim deleted file mode 100644 index 07d9c35..0000000 --- a/tests/tmain.nim +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | # gzip-like LZSS compressor | ||
2 | # Copyright (C) 2018 Pacien TRAN-GIRARD | ||
3 | # | ||
4 | # This program is free software: you can redistribute it and/or modify | ||
5 | # it under the terms of the GNU Affero General Public License as | ||
6 | # published by the Free Software Foundation, either version 3 of the | ||
7 | # License, or (at your option) any later version. | ||
8 | # | ||
9 | # This program is distributed in the hope that it will be useful, | ||
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | # GNU Affero General Public License for more details. | ||
13 | # | ||
14 | # You should have received a copy of the GNU Affero General Public License | ||
15 | # along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
16 | |||
17 | import unittest, os, ospaths, osproc | ||
18 | import main | ||
19 | |||
20 | const tempDir = "tmp" | ||
21 | |||
22 | suite "main": | ||
23 | setup: createDir(tempDir) | ||
24 | teardown: removeDir(tempDir) | ||
25 | |||
26 | test "identity (text)": | ||
27 | let input = "license.md" | ||
28 | let intermediate = tempDir / "compressed" | ||
29 | let final = tempDir / "decompressed" | ||
30 | compress.transform(input, intermediate) | ||
31 | decompress.transform(intermediate, final) | ||
32 | check startProcess("cmp", args=[input, final], options={poUsePath}).waitForExit() == 0 | ||
33 | |||
34 | test "identity (binary)": | ||
35 | let input = "tests" / "tmain" | ||
36 | let intermediate = tempDir / "compressed" | ||
37 | let final = tempDir / "decompressed" | ||
38 | compress.transform(input, intermediate) | ||
39 | decompress.transform(intermediate, final) | ||
40 | check startProcess("cmp", args=[input, final], options={poUsePath}).waitForExit() == 0 | ||