Skip to content

Commit

Permalink
fix: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Oct 18, 2023
1 parent b715e02 commit 61027be
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,38 @@ class TemplateRoleSplitterTest {
}


@Test
fun should_splitInputIntoSections() {
// given
val input = "```system```\nYou are a helpful assistant.\n\n```user```\n${'$'}{question}\n"
val expectedSections = mapOf(
"system" to "You are a helpful assistant.\n\n",
"user" to "${'$'}{question}\n\n"
)

// when
val sections = TemplateRoleSplitter().split(input)

// then
assertEquals(expectedSections, sections)
}

@Test
fun should_handleRemainingContentAfterLastSection() {
// given
val input = "```system```\nYou are a helpful assistant.\n\n```user```\n${'$'}{question}\nRemaining content"
val expectedSections = mapOf(
"system" to "You are a helpful assistant.\n\n",
"user" to "${'$'}{question}\nRemaining content\n"
)

// when
val sections = TemplateRoleSplitter().split(input)

// then
assertEquals(expectedSections, sections)
}

@Test
fun `should split input into sections`() {
// given
Expand Down

This file was deleted.

0 comments on commit 61027be

Please sign in to comment.