mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-02 05:47:31 +08:00
Ports doc-level auto-metadata extraction to Go and adds the knowledge_compiler component with scheduler/routing. Fixes Extractor metadata injection type assertion and enable_metadata default-on.
22 lines
652 B
Go
22 lines
652 B
Go
package common
|
|
|
|
import "testing"
|
|
|
|
// TestStableRowID_NULCollision locks that distinct part sequences can never
|
|
// share an id even when a part contains a NUL byte (length-prefixed encoding).
|
|
func TestStableRowID_NULCollision(t *testing.T) {
|
|
a := StableRowID("a\x00b")
|
|
b := StableRowID("a", "b")
|
|
if a == b {
|
|
t.Fatalf("StableRowID collided for [\"a\\x00b\"] and [\"a\",\"b\"]: %s", a)
|
|
}
|
|
// Determinism: same inputs always yield the same id.
|
|
if StableRowID("a", "b") != b {
|
|
t.Fatal("StableRowID is not deterministic")
|
|
}
|
|
// Order matters.
|
|
if StableRowID("a", "b") == StableRowID("b", "a") {
|
|
t.Fatal("StableRowID ignored part ordering")
|
|
}
|
|
}
|