diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/FunctionTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/FunctionTests.java index d954d30936..f0aa28a40c 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/FunctionTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/FunctionTests.java @@ -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() ); } ); }