Skip to content

Commit a179154

Browse files
committed
Reword stuff to satisfy spell-checker
Signed-off-by: Jim Klimov <[email protected]>
1 parent 62c2a4b commit a179154

File tree

3 files changed

+22
-20
lines changed

3 files changed

+22
-20
lines changed

.github/workflows/spelling/expect.txt

+3
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ notest
383383
NOTMAKE
384384
nroff
385385
NSTIPS
386+
nsub
386387
nvpool
387388
nytprof
388389
OBJC
@@ -419,6 +420,7 @@ plaintar
419420
plist
420421
plugin
421422
png
423+
poolrootfs
422424
populat
423425
posix
424426
prebuilt
@@ -461,6 +463,7 @@ rmdir
461463
rmprog
462464
rmtmp
463465
ron
466+
rootds
464467
rootfs
465468
rootfs'es
466469
rpool

lib/ZnapZend/ZFS.pm

+8-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ my $splitHostDataSet = sub {
4545
# If there are further bugs in the regex, comment away the
4646
# next implementation line and fall through to verbosely
4747
# debugging code below to try and iterate a fix.
48-
# In the "if" clause below we separate the regexes for the
49-
# use-case where we have two "@" characters:
48+
# In the "if" clause below we separate the regular expressions
49+
# for the use-case where we have two "@" characters:
5050
# user@host:dataset@snap
5151
# from having zero or one "@" characters:
5252
# host:dataset
@@ -57,6 +57,12 @@ my $splitHostDataSet = sub {
5757
# may have ":" chars of their own, e.g.
5858
# ...@znapzend-auto-2024-01-08T10:22:13Z
5959
# pond/export/vm-1:2
60+
# Also note that we can not discern "X@Y:Z" strings by pattern
61+
# alone - are they a remote "user@host:rootds" or a local
62+
# "rootds@funny:snapname"? For practical purposes, we proclaim
63+
# preference for the former: we are more likely to look at funny
64+
# local snapshot names, than to back up to (or otherwise care
65+
# about) remote pools' ROOT datasets.
6066
my $count = ($_[0] =~ tr/@//);
6167
if ($count > 1) {
6268
#return ($_[0] =~ /^(?:([^:\/]+):)?([^@\s]+|[^@\s]+\@[^@\s]+)$/);

t/znapzend-lib-splitter.t

+11-18
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# since there are many use-cases and combinations to take care of.
55
# We do so below by constructing "task" strings from components we
66
# know to be a dataset name and some defined (or not) remote spec
7-
# and/or snapshot name, and deconstructing it back with the class
7+
# and/or snapshot name, and de-constructing it back with the class
88
# method.
99
#
1010
# Copyright (C) 2024 by Jim Klimov <[email protected]>
@@ -135,9 +135,9 @@ for my $r (qw(undef hostname username@hostname)) {
135135

136136
# See big comment above:
137137
if ($task eq 'username@hostname:poolrootfs') {
138-
isnt (defined ($remote), 1, "remote should BOGUSLY be not defined after parsing for this exceptional test case");
139-
is (($dataSet eq "username"), 1, "dataSet has expected BOGUS value after parsing for this exceptional test case");
140-
is (($snapshot eq "hostname:poolrootfs"), 1, "snapshot has expected BOGUS value after parsing for this exceptional test case");
138+
isnt (defined ($remote), 1, "BOGUS exceptional test case: remote should be not defined after parsing for this exceptional test case");
139+
is (($dataSet eq "username"), 1, "BOGUS exceptional test case: dataSet has expected BOGUS value after parsing for this exceptional test case");
140+
is (($snapshot eq "hostname:poolrootfs"), 1, "BOGUS exceptional test case: snapshot has expected BOGUS value after parsing for this exceptional test case");
141141
} else {
142142
is (($dataSet eq $d), 1, "dataSet has expected value after parsing");
143143

@@ -181,22 +181,15 @@ for my $r (qw(undef hostname username@hostname)) {
181181
printTaskReportCFG($task, $remote, $dataSet);
182182

183183
is (defined ($dataSet), 1, "dataSet should always be defined after parsing");
184+
is (($dataSet eq $d), 1, "dataSet has expected value after parsing");
184185

185-
# See big comment above:
186-
# if ($task eq 'username@hostname:poolrootfs') {
187-
# isnt (defined ($remote), 1, "remote should BOGUSLY be not defined after parsing for this exceptional test case");
188-
# is (($dataSet eq "username"), 1, "dataSet has expected BOGUS value after parsing for this exceptional test case");
189-
# } else {
190-
is (($dataSet eq $d), 1, "dataSet has expected value after parsing");
191-
192-
if ($r ne "undef") {
193-
is (defined ($remote), 1, "remote should be defined after parsing this test case");
194-
is (($remote eq $r), 1, "remote has expected value after parsing");
195-
} else {
196-
isnt (defined ($remote), 1, "remote should not be defined after parsing this test case");
197-
}
186+
if ($r ne "undef") {
187+
is (defined ($remote), 1, "remote should be defined after parsing this test case");
188+
is (($remote eq $r), 1, "remote has expected value after parsing");
189+
} else {
190+
isnt (defined ($remote), 1, "remote should not be defined after parsing this test case");
198191
}
199-
# }
192+
}
200193
}
201194

202195
done_testing;

0 commit comments

Comments
 (0)