HHH-18783 test for trailing space handling in cast()
Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
parent
4fbade6076
commit
050da72ae9
|
@ -1139,9 +1139,18 @@ public class FunctionTests {
|
||||||
assertEquals( 'A',
|
assertEquals( 'A',
|
||||||
session.createQuery("select cast('ABCDEF' as Character)", Character.class)
|
session.createQuery("select cast('ABCDEF' as Character)", Character.class)
|
||||||
.getSingleResult() );
|
.getSingleResult() );
|
||||||
|
assertEquals( ' ',
|
||||||
|
session.createQuery("select cast(' X ' as Character)", Character.class)
|
||||||
|
.getSingleResult() );
|
||||||
assertEquals( "ABC",
|
assertEquals( "ABC",
|
||||||
session.createQuery("select cast('ABCDEF' as String(3))", String.class)
|
session.createQuery("select cast('ABCDEF' as String(3))", String.class)
|
||||||
.getSingleResult() );
|
.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() );
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue