aboutsummaryrefslogtreecommitdiff
path: root/internal/engine/exclude_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/engine/exclude_test.go')
-rw-r--r--internal/engine/exclude_test.go28
1 files changed, 12 insertions, 16 deletions
diff --git a/internal/engine/exclude_test.go b/internal/engine/exclude_test.go
index 7d9ce2a..36f1262 100644
--- a/internal/engine/exclude_test.go
+++ b/internal/engine/exclude_test.go
@@ -212,7 +212,7 @@ func TestExplainReportsExclusionAndSize(t *testing.T) {
// TestExcludeFailsClosedOnUnreadableContent: an exclude meant to protect
// files holds when its content test cannot read a file (over max-read), so
-// no rule acts on a file krino could not check (review M11).
+// no rule acts on a file krino could not check.
func TestExcludeFailsClosedOnUnreadableContent(t *testing.T) {
big := "confidential " + strings.Repeat("x", 2048)
h, dl := excludeTree(t, map[string]string{"big.txt": big, "small.txt": "nothing to hide"})
@@ -252,8 +252,7 @@ func TestExcludeFailsClosedOnUnreadableContent(t *testing.T) {
}
// TestLoadChecksMainExcludesWithoutDirectories: a mistake in krino.conf's
-// (exclude ...) is reported even before any directory is included (review
-// cli F10).
+// (exclude ...) is reported even before any directory is included.
func TestLoadChecksMainExcludesWithoutDirectories(t *testing.T) {
h := sandbox(t)
main := writeConfig(t, h, "(include)\n(exclude (bogus 1))\n", nil)
@@ -261,8 +260,7 @@ func TestLoadChecksMainExcludesWithoutDirectories(t *testing.T) {
t.Error("a broken krino.conf exclude was not reported")
}
// Checked with the defaults' case and fold, as a directory would compile
- // them (triage 28g): a keyword of a lone combining mark is empty only
- // when folded.
+ // them: a keyword of a lone combining mark is empty only when folded.
main = writeConfig(t, h, "(include)\n(defaults (fold no))\n(exclude (content \"\u0301\"))\n", nil)
if _, errs := Load(main); len(errs) != 0 {
t.Errorf("checked with fold on, though the defaults say no: %v", errs)
@@ -272,7 +270,7 @@ func TestLoadChecksMainExcludesWithoutDirectories(t *testing.T) {
// TestNoTextFormatIsNoMatch: a file whose format has no text cannot contain
// a keyword, so a content exclude without a type does not set it aside, and
// no "content unreadable" warning is raised - while a real read failure (over
-// max-read) still fails closed (re-review N2).
+// max-read) still fails closed.
func TestNoTextFormatIsNoMatch(t *testing.T) {
big := "confidential " + strings.Repeat("x", 2048)
h, dl := excludeTree(t, map[string]string{"photo.jpg": "\xff\xd8\xff\x00\x01binary", "big.txt": big})
@@ -314,8 +312,7 @@ func TestNoTextFormatIsNoMatch(t *testing.T) {
// TestTextTurningBinaryIsNoText: a file with no known extension whose first
// 8 KiB read as text but which holds a NUL further on - a self-extracting
// installer - counts as having no text, like an image: a content exclude
-// does not set it aside and there is no warning (decided after the plan 10
-// re-check).
+// does not set it aside and there is no warning.
func TestTextTurningBinaryIsNoText(t *testing.T) {
mixed := "confidential " + strings.Repeat("x", 9000) + "\x00tail"
h, _ := excludeTree(t, map[string]string{"mixed": mixed})
@@ -388,8 +385,7 @@ func partDocx(t *testing.T, path, body string) {
// TestPartlyReadableDocument: a docx with an unreadable part answers a
// keyword it holds in the readable part, but a keyword not found there is
-// unknown: a content exclude sets the file aside, a rule warns (plan 11,
-// re-review cache F3).
+// unknown: a content exclude sets the file aside, a rule warns.
func TestPartlyReadableDocument(t *testing.T) {
h, dl := excludeTree(t, map[string]string{})
os.MkdirAll(dl, 0o755)
@@ -435,7 +431,7 @@ func TestPartlyReadableDocument(t *testing.T) {
// TestExplainLeavesTheCacheAlone: explain never writes the keyword cache -
// not even to remove one a directory without content tests no longer uses
-// (triage 28e: explain runs without the directory's lock).
+// (explain runs without the directory's lock).
func TestExplainLeavesTheCacheAlone(t *testing.T) {
h, dl := excludeTree(t, map[string]string{"a.txt": "x"})
main := writeConfig(t, h, `(include "dl")`, map[string]string{"dl": "(path \"~/dl\")\n(rule \"all\" (move \"Out\"))\n"})
@@ -457,7 +453,7 @@ func TestExplainLeavesTheCacheAlone(t *testing.T) {
// TestPartlyReadableDocumentIsNotCached: a partial read's answers never
// enter the keyword cache, so a second run with the cache still sets the
-// file aside (plan 11 review M2).
+// file aside.
func TestPartlyReadableDocumentIsNotCached(t *testing.T) {
h, dl := excludeTree(t, map[string]string{})
os.MkdirAll(dl, 0o755)
@@ -485,7 +481,7 @@ func TestPartlyReadableDocumentIsNotCached(t *testing.T) {
// TestExplainAgreesWithMatchOnADuplicateExclude: a (duplicate) test inside
// an exclude needs the directory's other files, as one inside a rule does,
-// so explain sets aside exactly the files Match does (plan 11 review M3).
+// so explain sets aside exactly the files Match does.
func TestExplainAgreesWithMatchOnADuplicateExclude(t *testing.T) {
h, dl := excludeTree(t, map[string]string{"a.txt": "same", "b.txt": "same", "c.txt": "other"})
main := writeConfig(t, h, `(include "dl")`, map[string]string{"dl": `
@@ -514,7 +510,7 @@ func TestExplainAgreesWithMatchOnADuplicateExclude(t *testing.T) {
// TestNotMatchedAfterAnUnknownRuleDoesNotAct: a partly read document an
// earlier content rule could not decide is not caught by a later
-// (not (matched)) catch-all (plan 11 review L6).
+// (not (matched)) catch-all.
func TestNotMatchedAfterAnUnknownRuleDoesNotAct(t *testing.T) {
h, dl := excludeTree(t, map[string]string{})
os.MkdirAll(dl, 0o755)
@@ -549,7 +545,7 @@ func TestNotMatchedAfterAnUnknownRuleDoesNotAct(t *testing.T) {
}
// TestDuplicateExcludeFailsClosed: an exclude whose duplicate lookup fails
-// holds, marked as such (plan 12).
+// holds, marked as such.
func TestDuplicateExcludeFailsClosed(t *testing.T) {
if os.Getuid() == 0 {
t.Skip("root reads a chmod 000 file")
@@ -579,7 +575,7 @@ func TestDuplicateExcludeFailsClosed(t *testing.T) {
// TestUndecidedStopRuleStops: a (stop) rule whose condition cannot be
// decided ends the search for that file, so a later rule does not act on a
-// file the stop rule was written to keep (plan 12).
+// file the stop rule was written to keep.
func TestUndecidedStopRuleStops(t *testing.T) {
big := "confidential " + strings.Repeat("x", 2048)
h, dl := excludeTree(t, map[string]string{"big.txt": big, "small.txt": "nothing"})