From 47008eec5d29aac28ca913260f1e08779d3d35c7 Mon Sep 17 00:00:00 2001 From: Vijay Nayar Date: Thu, 7 Nov 2024 09:24:47 +0100 Subject: [PATCH] Add another quoting test with the string literal directly in the query rather than a parameter. --- hdtest/source/generaltest.d | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hdtest/source/generaltest.d b/hdtest/source/generaltest.d index a80f98d..dd46d98 100644 --- a/hdtest/source/generaltest.d +++ b/hdtest/source/generaltest.d @@ -263,8 +263,14 @@ class GeneralTest : HibernateTest { a1.name = "Bucky O'Hare"; int id = sess.save(a1).get!int; - auto query = sess.createQuery("FROM Asset WHERE name=:Name").setParameter("Name", "Bucky O'Hare").list!Asset; - assert(query.length == 1); + auto result = sess.createQuery("FROM Asset WHERE name=:Name") + .setParameter("Name", "Bucky O'Hare") + .list!Asset(); + assert(result.length == 1); + + result = sess.createQuery("FROM Asset WHERE name='Bucky O''Hare'") + .list!Asset(); + assert(result.length == 1); } }