Skip to content

Commit

Permalink
test(query-model): move length, locate method above the function method
Browse files Browse the repository at this point in the history
  • Loading branch information
waahhh committed Oct 19, 2023
1 parent 36edc5e commit 6f6bc31
Showing 1 changed file with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,38 @@ class ExpressionsTest : WithAssertions {
assertThat(actual).isEqualTo(expected)
}

@Test
fun length() {
// when
val actual = Expressions.length(stringExpression1)

// then
val expected = JpqlLength(
stringExpression1,
)

assertThat(actual).isEqualTo(expected)
}

@Test
fun locate() {
// when
val actual = Expressions.locate(
substring = stringExpression1,
string = stringExpression2,
start = intExpression1,
)

// then
val expected = JpqlLocate(
substring = stringExpression1,
string = stringExpression2,
start = intExpression1,
)

assertThat(actual).isEqualTo(expected)
}

@Test
fun function() {
// when
Expand Down Expand Up @@ -711,36 +743,4 @@ class ExpressionsTest : WithAssertions {

assertThat(actual).isEqualTo(expected)
}

@Test
fun length() {
// when
val actual = Expressions.length(stringExpression1)

// then
val expected = JpqlLength(
stringExpression1,
)

assertThat(actual).isEqualTo(expected)
}

@Test
fun locate() {
// when
val actual = Expressions.locate(
substring = stringExpression1,
string = stringExpression2,
start = intExpression1,
)

// then
val expected = JpqlLocate(
substring = stringExpression1,
string = stringExpression2,
start = intExpression1,
)

assertThat(actual).isEqualTo(expected)
}
}

0 comments on commit 6f6bc31

Please sign in to comment.