Scanyonero/ocrmypdf/cli_test.go
David Vogel 853a1bb58d Rework into FTP scanning server
- Rename to Scanyonero
- Add FTP server that ingests TIFF, PNG, JPEG or PDF files
- Add web interface to check and modify ingested files
- Rework how ocrmypdf is invoked

Basics are working, but the program is not in a usable state.
2025-05-14 12:08:38 +02:00

41 lines
806 B
Go

package ocrmypdf_test
import (
"Scanyonero/ocrmypdf"
"os"
"path/filepath"
"testing"
)
func TestCLI_VersionString(t *testing.T) {
cli := ocrmypdf.CLI{}
v, err := cli.VersionString()
if err != nil {
t.Fatalf("VersionString() returned error: %v", err)
}
if v == "" {
t.Errorf("Returned version string is empty: %v", v)
}
}
func TestCLI_Run(t *testing.T) {
t.SkipNow()
cli := ocrmypdf.CLI{}
source, err := os.Open(filepath.Join(".", "..", "test-documents", "typst-example", "600 DPI Flatbed.pdf"))
if err != nil {
t.Fatalf("Couldn't open file: %v.", err)
}
dest, err := os.Create(filepath.Join(".", "Output.pdf"))
if err != nil {
t.Fatalf("Couldn't create file: %v.", err)
}
if err := cli.Run(source, dest, nil); err != nil {
t.Fatalf("Run() returned error: %v", err)
}
}