Cthulhu is no longer a fork. Now it is a screen reader written in Golang.
This commit is contained in:
1 parent
a998fe67de
commit
069fc674dc
708 files changed
+112482
-532
No files matched your search
@@ -0,0 +1,30 @@
|
||||
package ocr
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPageMovementRetainsColumnAndBounds(t *testing.T) {
|
||||
lines := make([]string, 45)
|
||||
for index := range lines {
|
||||
lines[index] = "abcd"
|
||||
}
|
||||
cursor := NewCursor(Result{Text: strings.Join(lines, "\n")})
|
||||
cursor.Set(3)
|
||||
if got := cursor.Move(PageUnit, 1); got.Line != "abcd" || got.Cursor != 3 || got.Offset != 103 {
|
||||
t.Fatal(got)
|
||||
}
|
||||
if got := cursor.Move(PageUnit, 1); got.Offset != 203 {
|
||||
t.Fatal(got)
|
||||
}
|
||||
if got := cursor.Move(PageUnit, 1); got.Offset != 223 {
|
||||
t.Fatal(got)
|
||||
}
|
||||
if got := cursor.Move(PageUnit, 1); got.Moved {
|
||||
t.Fatal(got)
|
||||
}
|
||||
if got := cursor.Move(PageUnit, -1); got.Offset != 123 {
|
||||
t.Fatal(got)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user