Skip to content

Commit b9dd73f

Browse files
committed
Add test for tiny documents
1 parent af0839d commit b9dd73f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.microsoft.openai.samples.indexer.parser;
2+
3+
import com.microsoft.openai.samples.indexer.SplitPage;
4+
import org.junit.jupiter.api.Test;
5+
6+
import java.util.List;
7+
8+
import static org.junit.jupiter.api.Assertions.*;
9+
10+
class TextSplitterTest {
11+
12+
@Test
13+
void testSplitTinyPages() {
14+
List<Page> testPages = List.of(new Page[]{
15+
new Page(1, 0, "hello, world")
16+
});
17+
TextSplitter splitter = new TextSplitter(false);
18+
List<SplitPage> result = splitter.splitPages(testPages);
19+
assertEquals(1, result.size());
20+
assertEquals("hello, world", result.get(0).getText());
21+
}
22+
}

0 commit comments

Comments
 (0)