mirror of
https://github.com/napnap75/multiarch-docker-images.git
synced 2026-11-16 19:01:48 +01:00
Archivist : page Outils + outil « Recherche des fichiers perdus » (US-40, US-41) (#16)
* Add tools page with find-lost-files consistency tool (US-40, US-41) Co-authored-by: napnap75 <napnap75@users.noreply.github.com> * tools page: hide the job panel when there is nothing to show, guard against undefined rendering Co-authored-by: napnap75 <napnap75@users.noreply.github.com> * inbox: leave non-PDF objects in place, never imported (US-12) Co-authored-by: napnap75 <napnap75@users.noreply.github.com> --------- Co-authored-by: Vibe Nuage Agent <vibe@mistral.ai> Co-authored-by: napnap75 <napnap75@users.noreply.github.com>
This commit is contained in:
co-authored by
napnap75
Vibe Nuage Agent
parent
85784ef578
commit
1224ff916d
@@ -0,0 +1,24 @@
|
||||
package pipeline
|
||||
|
||||
import "testing"
|
||||
|
||||
// TestIsPDF covers the inbox rule: only content carrying the %PDF- header
|
||||
// enters the pipeline; anything else is left in place (US-12).
|
||||
func TestIsPDF(t *testing.T) {
|
||||
cases := []struct {
|
||||
name string
|
||||
data []byte
|
||||
want bool
|
||||
}{
|
||||
{"pdf header", []byte("%PDF-1.7\n..."), true},
|
||||
{"pdf header with leading whitespace", []byte("\n%PDF-1.4"), false},
|
||||
{"plain text", []byte("not a pdf at all\n"), false},
|
||||
{"image content", []byte("\x89PNG\r\n\x1a\n..."), false},
|
||||
{"empty", nil, false},
|
||||
}
|
||||
for _, c := range cases {
|
||||
if got := isPDF(c.data); got != c.want {
|
||||
t.Errorf("%s: isPDF = %v, want %v", c.name, got, c.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user