Skip to content

Commit 9a06bb6

Browse files
author
Dimitar Grigorov
committed
Fixed ubuntu tests
1 parent 605af23 commit 9a06bb6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test_server.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ func main() {
9090
}
9191
check("directory_tree (exclude)", !r11.IsError && !hasFile)
9292

93-
// Head/tail
93+
// Offset/Limit pagination
9494
multiFile := filepath.Join(tempDir, "multi.txt")
95-
os.WriteFile(multiFile, []byte("a\nb\nc\nd\n"), 0644)
96-
head, tail := 2, 2
97-
r12, o12, _ := h.HandleReadTextFile(ctx, nil, handler.ReadTextFileInput{Path: multiFile, Head: &head})
98-
check("read_text_file (head)", !r12.IsError && o12.Content == "a\nb")
95+
os.WriteFile(multiFile, []byte("a\nb\nc\nd"), 0644)
96+
limit, offset := 2, 3
97+
r12, o12, _ := h.HandleReadTextFile(ctx, nil, handler.ReadTextFileInput{Path: multiFile, Limit: &limit})
98+
check("read_text_file (limit=2)", !r12.IsError && o12.Content == "a\nb")
9999

100-
r13, o13, _ := h.HandleReadTextFile(ctx, nil, handler.ReadTextFileInput{Path: multiFile, Tail: &tail})
101-
check("read_text_file (tail)", !r13.IsError && o13.Content == "d\n")
100+
r13, o13, _ := h.HandleReadTextFile(ctx, nil, handler.ReadTextFileInput{Path: multiFile, Offset: &offset, Limit: &limit})
101+
check("read_text_file (offset=3, limit=2)", !r13.IsError && o13.Content == "c\nd")
102102

103103
// Auto-detect and encoding registry
104104
r14, o14, _ := h.HandleReadTextFile(ctx, nil, handler.ReadTextFileInput{Path: cyrillicFile})

0 commit comments

Comments
 (0)