Skip to content

Commit

Permalink
HHH-18859 add a test for string slice operator
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinking committed Nov 18, 2024
1 parent cfc4b0a commit dd80b3e
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2526,6 +2526,23 @@ public void testTupleInSelect(SessionFactoryScope scope) {
);
}

@Test
public void testSlice(SessionFactoryScope scope) {
scope.inTransaction(
session -> {
assertEquals("ring",
session.createSelectionQuery("select theString[3:6] from EntityOfBasics", String.class)
.getSingleResult());
assertEquals('s',
session.createSelectionQuery("select theString[1] from EntityOfBasics", Character.class)
.getSingleResult());
assertEquals('y',
session.createSelectionQuery("select theString[7] from EntityOfBasics", Character.class)
.getSingleResult());
}
);
}

@Test
@SkipForDialect(dialectClass = H2Dialect.class)
@SkipForDialect(dialectClass = DerbyDialect.class)
Expand Down

0 comments on commit dd80b3e

Please sign in to comment.