Files
ragflow/internal/parser/parser/office_parsers_nocgo_test.go
qinling0210 d549194562 Implement builtin chunk method as ingestion pipeline in GO (#16822)
### Summary

Implement builtin chunk mehtod as ingestion pipeline in GO
2026-07-13 13:51:40 +08:00

31 lines
751 B
Go

//go:build !cgo
package parser
import (
"errors"
"testing"
)
func TestOfficeParsers_ParseWithResult_NoCGO(t *testing.T) {
cases := []struct {
name string
res ParseResult
}{
{name: "docx", res: (&DOCXParser{}).ParseWithResult("a.docx", nil)},
{name: "doc", res: (&DOCParser{}).ParseWithResult("a.doc", nil)},
{name: "pptx", res: (&PPTXParser{}).ParseWithResult("a.pptx", nil)},
{name: "ppt", res: (&PPTParser{}).ParseWithResult("a.ppt", nil)},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
if tc.res.Err == nil {
t.Fatal("want ErrOfficeCGORequired, got nil")
}
if !errors.Is(tc.res.Err, ErrOfficeCGORequired) {
t.Fatalf("err = %v, want wraps ErrOfficeCGORequired", tc.res.Err)
}
})
}
}