From e2e6441e930731bb8f23764bc1a6b04026617b50 Mon Sep 17 00:00:00 2001
From: Mooffie <mooffie@gmail.com>
Date: Sun, 20 Nov 2016 06:04:26 +0200
Subject: [PATCH 09/11] extfs: urar: add tests.
---
tests/src/extfs-helpers-listcmd/Makefile.am | 7 ++
tests/src/extfs-helpers-listcmd/data/urar.README | 17 ++++
.../extfs-helpers-listcmd/data/urar.v4,v3.env_vars | 1 +
.../extfs-helpers-listcmd/data/urar.v4,v3.input | 29 ++++++
.../extfs-helpers-listcmd/data/urar.v4,v3.output | 9 ++
.../extfs-helpers-listcmd/data/urar.v5.env_vars | 1 +
tests/src/extfs-helpers-listcmd/data/urar.v5.input | 102 +++++++++++++++++++++
.../src/extfs-helpers-listcmd/data/urar.v5.output | 9 ++
8 files changed, 175 insertions(+)
create mode 100644 tests/src/extfs-helpers-listcmd/data/urar.README
create mode 100644 tests/src/extfs-helpers-listcmd/data/urar.v4,v3.env_vars
create mode 100644 tests/src/extfs-helpers-listcmd/data/urar.v4,v3.input
create mode 100644 tests/src/extfs-helpers-listcmd/data/urar.v4,v3.output
create mode 100644 tests/src/extfs-helpers-listcmd/data/urar.v5.env_vars
create mode 100644 tests/src/extfs-helpers-listcmd/data/urar.v5.input
create mode 100644 tests/src/extfs-helpers-listcmd/data/urar.v5.output
diff --git a/tests/src/extfs-helpers-listcmd/Makefile.am b/tests/src/extfs-helpers-listcmd/Makefile.am
index e205882..aec7d0a 100644
a
|
b
|
mc_parse_ls_l_SOURCES = \ |
22 | 22 | mc_parse_ls_l.c |
23 | 23 | |
24 | 24 | data_files_to_distribute = \ |
| 25 | data/urar.README \ |
| 26 | data/urar.v4,v3.env_vars \ |
| 27 | data/urar.v4,v3.input \ |
| 28 | data/urar.v4,v3.output \ |
| 29 | data/urar.v5.env_vars \ |
| 30 | data/urar.v5.input \ |
| 31 | data/urar.v5.output \ |
25 | 32 | data/uzip.README \ |
26 | 33 | data/uzip.with-zipinfo.env_vars \ |
27 | 34 | data/uzip.with-zipinfo.input \ |
diff --git a/tests/src/extfs-helpers-listcmd/data/urar.README b/tests/src/extfs-helpers-listcmd/data/urar.README
new file mode 100644
index 0000000..75f1297
-
|
+
|
|
| 1 | |
| 2 | The archive was created thus: |
| 3 | |
| 4 | echo hello > 'filename with spaces.txt' |
| 5 | rar a archive.rar 'filename with spaces.txt' ... |
| 6 | |
| 7 | Our 'urar' supports two listing formats: that of version 5, and that of |
| 8 | version 4. |
| 9 | |
| 10 | 'urar.v5.input' was created with "unrar vt -c- -cfg- archive.rar" using |
| 11 | unrar 5.30. |
| 12 | |
| 13 | 'urar.v4,v3.input' was created with "unrar v -c- -cfg- archive.rar" using |
| 14 | unrar 3.80 for DOS (google "unrar dos"), via DOSBox (and then the "\" was |
| 15 | changed to "/" by hand). An inspection of our urar's source code should |
| 16 | lead us to conclude that this format is compatible with that of version |
| 17 | 4. |
diff --git a/tests/src/extfs-helpers-listcmd/data/urar.v4,v3.env_vars b/tests/src/extfs-helpers-listcmd/data/urar.v4,v3.env_vars
new file mode 100644
index 0000000..475a847
-
|
+
|
|
| 1 | MC_TEST_EXTFS_UNRAR_VERSION=4 |
diff --git a/tests/src/extfs-helpers-listcmd/data/urar.v4,v3.input b/tests/src/extfs-helpers-listcmd/data/urar.v4,v3.input
new file mode 100644
index 0000000..75f7948
-
|
+
|
|
| 1 | |
| 2 | UNRAR 3.80 freeware Copyright (c) 1993-2008 Alexander Roshal |
| 3 | |
| 4 | Archive ARCHIVE.RAR |
| 5 | |
| 6 | Pathname/Comment |
| 7 | Size Packed Ratio Date Time Attr CRC Meth Ver |
| 8 | ------------------------------------------------------------------------------- |
| 9 | .viminfo |
| 10 | 11032 2468 22% 23-11-16 07:10 -rw------- 295ED9AB m3g 2.9 |
| 11 | .wget-hsts |
| 12 | 205 181 88% 26-10-16 13:14 -rw-rw-r-- 58429CA4 m3g 2.9 |
| 13 | .xboardrc |
| 14 | 7527 2964 39% 17-04-16 01:21 -rw-rw-r-- 1DA6AD04 m3g 2.9 |
| 15 | .xchm |
| 16 | 559 382 68% 29-09-16 01:08 -rw-rw-r-- 73DBF2B9 m3g 2.9 |
| 17 | .xinputrc |
| 18 | 130 123 94% 27-12-15 17:08 -rw-rw-r-- 70CD8EF3 m3g 2.9 |
| 19 | .dosbox/dosbox-0.74.conf |
| 20 | 10730 4005 37% 07-06-16 20:43 -rw-rw-r-- 1D5A9AA6 m3g 2.9 |
| 21 | log.txt |
| 22 | 5869937 42114 0% 23-11-16 07:43 -rw-rw-r-- E63DE4A6 m3g 2.9 |
| 23 | filename with spaces.txt |
| 24 | 6 16 266% 23-11-16 07:39 -rw-r--r-- 363A3020 m3g 2.9 |
| 25 | .dosbox |
| 26 | 0 0 0% 07-06-16 20:43 drwx------ 00000000 m0 2.0 |
| 27 | ------------------------------------------------------------------------------- |
| 28 | 9 5900126 52253 0% |
| 29 | |
diff --git a/tests/src/extfs-helpers-listcmd/data/urar.v4,v3.output b/tests/src/extfs-helpers-listcmd/data/urar.v4,v3.output
new file mode 100644
index 0000000..771ab45
-
|
+
|
|
| 1 | drwx------ 1 <<uid>> <<gid>> 0 2016-06-07 20:43:00 ./.dosbox |
| 2 | -rw-rw-r-- 1 <<uid>> <<gid>> 10730 2016-06-07 20:43:00 ./.dosbox/dosbox-0.74.conf |
| 3 | -rw-r--r-- 1 <<uid>> <<gid>> 6 2016-11-23 07:39:00 ./filename with spaces.txt |
| 4 | -rw-rw-r-- 1 <<uid>> <<gid>> 5869937 2016-11-23 07:43:00 ./log.txt |
| 5 | -rw------- 1 <<uid>> <<gid>> 11032 2016-11-23 07:10:00 ./.viminfo |
| 6 | -rw-rw-r-- 1 <<uid>> <<gid>> 205 2016-10-26 13:14:00 ./.wget-hsts |
| 7 | -rw-rw-r-- 1 <<uid>> <<gid>> 7527 2016-04-17 01:21:00 ./.xboardrc |
| 8 | -rw-rw-r-- 1 <<uid>> <<gid>> 559 2016-09-29 01:08:00 ./.xchm |
| 9 | -rw-rw-r-- 1 <<uid>> <<gid>> 130 2015-12-27 17:08:00 ./.xinputrc |
diff --git a/tests/src/extfs-helpers-listcmd/data/urar.v5.env_vars b/tests/src/extfs-helpers-listcmd/data/urar.v5.env_vars
new file mode 100644
index 0000000..abdefcc
-
|
+
|
|
| 1 | MC_TEST_EXTFS_UNRAR_VERSION=5 |
diff --git a/tests/src/extfs-helpers-listcmd/data/urar.v5.input b/tests/src/extfs-helpers-listcmd/data/urar.v5.input
new file mode 100644
index 0000000..5039076
-
|
+
|
|
| 1 | |
| 2 | UNRAR 5.30 beta 2 freeware Copyright (c) 1993-2015 Alexander Roshal |
| 3 | |
| 4 | Archive: archive.rar |
| 5 | Details: RAR 4 |
| 6 | |
| 7 | Name: .viminfo |
| 8 | Type: File |
| 9 | Size: 11032 |
| 10 | Packed size: 2468 |
| 11 | Ratio: 22% |
| 12 | mtime: 2016-11-23 07:10:39,000 |
| 13 | Attributes: -rw------- |
| 14 | CRC32: 295ED9AB |
| 15 | Host OS: Unix |
| 16 | Compression: RAR 3.0(v29) -m3 -md=4M |
| 17 | |
| 18 | Name: .wget-hsts |
| 19 | Type: File |
| 20 | Size: 205 |
| 21 | Packed size: 181 |
| 22 | Ratio: 88% |
| 23 | mtime: 2016-10-26 13:14:09,000 |
| 24 | Attributes: -rw-rw-r-- |
| 25 | CRC32: 58429CA4 |
| 26 | Host OS: Unix |
| 27 | Compression: RAR 3.0(v29) -m3 -md=4M |
| 28 | |
| 29 | Name: .xboardrc |
| 30 | Type: File |
| 31 | Size: 7527 |
| 32 | Packed size: 2964 |
| 33 | Ratio: 39% |
| 34 | mtime: 2016-04-17 01:21:46,000 |
| 35 | Attributes: -rw-rw-r-- |
| 36 | CRC32: 1DA6AD04 |
| 37 | Host OS: Unix |
| 38 | Compression: RAR 3.0(v29) -m3 -md=4M |
| 39 | |
| 40 | Name: .xchm |
| 41 | Type: File |
| 42 | Size: 559 |
| 43 | Packed size: 382 |
| 44 | Ratio: 68% |
| 45 | mtime: 2016-09-29 01:08:46,000 |
| 46 | Attributes: -rw-rw-r-- |
| 47 | CRC32: 73DBF2B9 |
| 48 | Host OS: Unix |
| 49 | Compression: RAR 3.0(v29) -m3 -md=4M |
| 50 | |
| 51 | Name: .xinputrc |
| 52 | Type: File |
| 53 | Size: 130 |
| 54 | Packed size: 123 |
| 55 | Ratio: 94% |
| 56 | mtime: 2015-12-27 17:08:35,000 |
| 57 | Attributes: -rw-rw-r-- |
| 58 | CRC32: 70CD8EF3 |
| 59 | Host OS: Unix |
| 60 | Compression: RAR 3.0(v29) -m3 -md=4M |
| 61 | |
| 62 | Name: .dosbox/dosbox-0.74.conf |
| 63 | Type: File |
| 64 | Size: 10730 |
| 65 | Packed size: 4005 |
| 66 | Ratio: 37% |
| 67 | mtime: 2016-06-07 20:43:58,000 |
| 68 | Attributes: -rw-rw-r-- |
| 69 | CRC32: 1D5A9AA6 |
| 70 | Host OS: Unix |
| 71 | Compression: RAR 3.0(v29) -m3 -md=4M |
| 72 | |
| 73 | Name: log.txt |
| 74 | Type: File |
| 75 | Size: 5869937 |
| 76 | Packed size: 42114 |
| 77 | Ratio: 0% |
| 78 | mtime: 2016-11-23 07:43:18,000 |
| 79 | Attributes: -rw-rw-r-- |
| 80 | CRC32: E63DE4A6 |
| 81 | Host OS: Unix |
| 82 | Compression: RAR 3.0(v29) -m3 -md=4M |
| 83 | |
| 84 | Name: filename with spaces.txt |
| 85 | Type: File |
| 86 | Size: 6 |
| 87 | Packed size: 16 |
| 88 | Ratio: 266% |
| 89 | mtime: 2016-11-23 07:39:15,000 |
| 90 | Attributes: -rw-r--r-- |
| 91 | CRC32: 363A3020 |
| 92 | Host OS: Unix |
| 93 | Compression: RAR 3.0(v29) -m3 -md=4M |
| 94 | |
| 95 | Name: .dosbox |
| 96 | Type: Directory |
| 97 | mtime: 2016-06-07 20:43:58,000 |
| 98 | Attributes: drwx------ |
| 99 | CRC32: 00000000 |
| 100 | Host OS: Unix |
| 101 | Compression: RAR 3.0(v20) -m0 -md=0K |
| 102 | |
diff --git a/tests/src/extfs-helpers-listcmd/data/urar.v5.output b/tests/src/extfs-helpers-listcmd/data/urar.v5.output
new file mode 100644
index 0000000..771ab45
-
|
+
|
|
| 1 | drwx------ 1 <<uid>> <<gid>> 0 2016-06-07 20:43:00 ./.dosbox |
| 2 | -rw-rw-r-- 1 <<uid>> <<gid>> 10730 2016-06-07 20:43:00 ./.dosbox/dosbox-0.74.conf |
| 3 | -rw-r--r-- 1 <<uid>> <<gid>> 6 2016-11-23 07:39:00 ./filename with spaces.txt |
| 4 | -rw-rw-r-- 1 <<uid>> <<gid>> 5869937 2016-11-23 07:43:00 ./log.txt |
| 5 | -rw------- 1 <<uid>> <<gid>> 11032 2016-11-23 07:10:00 ./.viminfo |
| 6 | -rw-rw-r-- 1 <<uid>> <<gid>> 205 2016-10-26 13:14:00 ./.wget-hsts |
| 7 | -rw-rw-r-- 1 <<uid>> <<gid>> 7527 2016-04-17 01:21:00 ./.xboardrc |
| 8 | -rw-rw-r-- 1 <<uid>> <<gid>> 559 2016-09-29 01:08:00 ./.xchm |
| 9 | -rw-rw-r-- 1 <<uid>> <<gid>> 130 2015-12-27 17:08:00 ./.xinputrc |