HHH-18783 test for trailing space handling in cast()

Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
Gavin King 2024-11-04 17:41:12 +01:00
parent 4fbade6076
commit 050da72ae9
1 changed files with 9 additions and 0 deletions

View File

@ -1139,9 +1139,18 @@ public class FunctionTests {
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() );
}
);
}