Add files via upload

This commit is contained in:
公明 authored and GitHub committed 2026-08-15 02:14:36 +08:00
1 parent 9f38fda15f
commit ee4676a591
72 files changed
+11131

No files matched your search

@@ -0,0 +1,20 @@
package knowledge
import "testing"
func TestIndexerRejectsConcurrentIndexRuns(t *testing.T) {
idx := &Indexer{}
if err := idx.beginIndexRun(); err != nil {
t.Fatalf("first index run should start: %v", err)
}
if err := idx.beginIndexRun(); err == nil {
t.Fatal("second index run should be rejected while one is active")
}
idx.FinishIndexRun()
if err := idx.beginIndexRun(); err != nil {
t.Fatalf("index run should start again after finish: %v", err)
}
idx.FinishIndexRun()
}