package sync import ( "os" "testing" ) func TestManualRealBookAnchor(t *testing.T) { path := "/home/nymusicman/Code/bookhoard/uploads/Ebooks/George Orwell/1984 (1269)/1984 - George Orwell.epub" if _, err := os.Stat(path); err != nil { t.Skip("real book not present on this machine") } cfi := "epubcfi(/6/2!/4[x1984]/8[_idContainer003]/62/1:456)" ctx := "was at war with one of these Powers it was generally at peace with the other" finalCFI, sel, href, charOff, _, healedPct, healed, err := VerifyProgressAnchor(path, cfi, ctx, 0.0415) if err != nil { t.Fatalf("VerifyProgressAnchor error: %v", err) } t.Logf("final=%q\n healed=%v healedPct=%v\n selector=%q href=%q charOff=%v", finalCFI, healed, healedPct, sel, href, charOff) sel2, err2 := ProgressCSSSelector(path, cfi) t.Logf("ProgressCSSSelector: %q err=%v", sel2, err2) }