From cc427b56ac0445c88ea33e4ba937d0c2b4aaed6d Mon Sep 17 00:00:00 2001 From: Gavin King Date: Sat, 19 Aug 2023 10:47:20 +0200 Subject: [PATCH] add missing LiteralTests for floating point literals --- .../hibernate/orm/test/query/hql/LiteralTests.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/LiteralTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/LiteralTests.java index aff9078f40..2aef7e6ced 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/LiteralTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/LiteralTests.java @@ -340,6 +340,19 @@ public class LiteralTests { ); } + @Test + public void testFloatingPointLiteralInSelect(SessionFactoryScope scope) { + scope.inTransaction( + session -> { + assertThat( session.createQuery( "select 1.0" ).getSingleResult(), is( 1.0 ) ); + assertThat( session.createQuery( "select 123.456" ).getSingleResult(), is( 123.456 ) ); + assertThat( session.createQuery( "select 123.456F" ).getSingleResult(), is( 123.456F ) ); + assertThat( session.createQuery( "select 123.456D" ).getSingleResult(), is( 123.456D ) ); + assertThat( session.createQuery( "select 1.23e45" ).getSingleResult(), is( 1.23e45 ) ); + } + ); + } + @Test public void testEnumLiteralInSelect(SessionFactoryScope scope) { scope.inTransaction(