Skip to content

Commit

Permalink
HHH-18783 test for trailing space handling in cast()
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin King <[email protected]>
  • Loading branch information
gavinking committed Nov 4, 2024
1 parent 4fbade6 commit 050da72
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1139,9 +1139,18 @@ public void testCastFunctionWithLength(SessionFactoryScope scope) {
assertEquals( 'A',
session.createQuery("select cast('ABCDEF' as Character)", Character.class)
.getSingleResult() );
assertEquals( ' ',
session.createQuery("select cast(' X ' as Character)", Character.class)
.getSingleResult() );
assertEquals( "ABC",
session.createQuery("select cast('ABCDEF' as String(3))", String.class)
.getSingleResult() );
assertEquals( "ABC",
session.createQuery("select cast('ABC' as String(6))", String.class)
.getSingleResult() );
assertEquals( "ABC ",
session.createQuery("select cast('ABC DEF' as String(4))", String.class)
.getSingleResult() );
}
);
}
Expand Down

0 comments on commit 050da72

Please sign in to comment.