Skip to content

Commit 8a0dc13

Browse files
committed
test case with distribution with "+"
This used to fail to work until today (distribution Text-Tabs+Wrap).
1 parent 690ff97 commit 8a0dc13

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

t/tail-log-to-ndjson.t

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ my @cmd = (
6363
The last 1000 reports as of 2025-10-18T08:00:04Z:
6464
[2025-10-18T07:59:49Z] [Carlos Guevara] [pass] [JKEENAN/IPC-System-Simple-1.30.tar.gz] [i86pc-solaris-thread-multi-64] [perl-v5.43.4] [6bad3778-abf8-11f0-8c1e-b80f595f57ba] [2025-10-18T07:59:49Z]
6565
[2025-10-18T07:59:43Z] [Carlos Guevara] [unknown] [JDHEDDEN/threads-2.21.tar.gz] [amd64-netbsd-thread-multi] [perl-v5.43.4] [67e088d4-abf8-11f0-97a1-bb460411313d] [2025-10-18T07:59:43Z]
66+
[2025-10-18T07:54:07Z] [Chris Williams (BINGOS)] [pass] [/] [x86_64-linux] [perl-v5.18.2] [a018b394-abf7-11f0-a3bc-a055f9c4ba34] [2025-10-18T07:54:07Z]
67+
[2025-10-18T07:40:24Z] [Carlos Guevara] [pass] [ARISTOTLE/Text-Tabs+Wrap-2024.001.tar.gz] [i86pc-solaris-thread-multi-64] [perl-v5.43.4] [b50809d2-abf5-11f0-ab63-d1797d8a4f3d] [2025-10-18T07:40:24Z]
6668
EOF
6769
close $ofh;
6870

@@ -71,6 +73,9 @@ EOF
7173
EOF
7274
my $exptected_threads_ndjson_contents = <<'EOF';
7375
{"archname":"amd64-netbsd-thread-multi","distribution":"threads","fulldate":"202510180759","guid":"67e088d4-abf8-11f0-97a1-bb460411313d","osname":"netbsd","perl":"5.43.4","status":"UNKNOWN","tester":"Carlos Guevara","version":"2.21"}
76+
EOF
77+
my $expected_Text_Tabs_Wrap_ndjson_contents = <<'EOF';
78+
{"archname":"i86pc-solaris-thread-multi-64","distribution":"Text-Tabs+Wrap","fulldate":"202510180740","guid":"b50809d2-abf5-11f0-ab63-d1797d8a4f3d","osname":"solaris","perl":"5.43.4","status":"PASS","tester":"Carlos Guevara","version":"2024.001"}
7479
EOF
7580

7681
for my $pass (1..2) {
@@ -79,14 +84,17 @@ EOF
7984
if ($pass == 1) {
8085
like $err, qr{\QIPC-System-Simple.ndjson... (first-time creation) (no existing \E.*/log-as-json/IPC-System-Simple.json\Q...) (writing data...)}, "expected diagnostics for IPC-System-Simple (pass $pass)";
8186
like $err, qr{\Qthreads.ndjson... (first-time creation) (no existing \E.*/log-as-json/threads.json\Q...) (writing data...)}, "expected diagnostics for threads (pass $pass)";
87+
like $err, qr{\QText-Tabs+Wrap.ndjson... (first-time creation) (no existing \E.*/log-as-json/Text-Tabs\+Wrap.json\Q...) (writing data...)}, "expected diagnostics for Text-Tabs+Wrap (pass $pass)";
8288
} else {
8389
like $err, qr{\QIPC-System-Simple.ndjson... (append to existing ndjson file...) (found last guid...) (no new data found...)}, "expected diagnostics for IPC-System-Simple (pass $pass)";
8490
like $err, qr{\Qthreads.ndjson... (append to existing ndjson file...) (found last guid...) (no new data found...)}, "expected diagnostics for threads (pass $pass)";
91+
like $err, qr{\QText-Tabs+Wrap.ndjson... (append to existing ndjson file...) (found last guid...) (no new data found...)}, "expected diagnostics for Text-Tabs+Wrap (pass $pass)";
8592
}
93+
like $err, qr{\QCannot parse dist '/' in line '[2025-10-18T07:54:07Z] [Chris Williams (BINGOS)] [pass] [/] [x86_64-linux] [perl-v5.18.2] [a018b394-abf7-11f0-a3bc-a055f9c4ba34] [2025-10-18T07:54:07Z]'}, 'unparsable dist';
8694
is slurp("$ndjson_dir/IPC-System-Simple.ndjson"), $exptected_IPC_System_Simple_ndjson_contents, 'IPC-System-Simple.ndjson contents OK';
8795
is slurp("$ndjson_dir/threads.ndjson"), $exptected_threads_ndjson_contents, 'threads.ndjson contents OK';
8896
my @ndjson_files = <$ndjson_dir/*>;
89-
is scalar(@ndjson_files), 2, 'expected two files';
97+
is scalar(@ndjson_files), 3, 'expected number of files';
9098
}
9199
}
92100

0 commit comments

Comments
 (0)