extra test for 'is distinct from'
This commit is contained in:
parent
b7120a60a3
commit
1807e1cc43
|
@ -19,6 +19,8 @@ import org.junit.jupiter.api.Assertions;
|
|||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
* @author Christian Beikov
|
||||
*/
|
||||
|
@ -115,4 +117,19 @@ public class DistinctFromTest {
|
|||
);
|
||||
}
|
||||
|
||||
@Test void testNulls(SessionFactoryScope scope) {
|
||||
scope.inSession(session -> {
|
||||
assertEquals(1, session.createSelectionQuery("select 1 where 1 is distinct from 0").getResultList().size());
|
||||
assertEquals(0, session.createSelectionQuery("select 1 where 1 is distinct from 1").getResultList().size());
|
||||
assertEquals(1, session.createSelectionQuery("select 1 where null is distinct from 1").getResultList().size());
|
||||
assertEquals(1, session.createSelectionQuery("select 1 where null is distinct from 0").getResultList().size());
|
||||
assertEquals(0, session.createSelectionQuery("select 1 where null is distinct from null").getResultList().size());
|
||||
|
||||
assertEquals(0, session.createSelectionQuery("select 1 where 1 is not distinct from 0").getResultList().size());
|
||||
assertEquals(1, session.createSelectionQuery("select 1 where 1 is not distinct from 1").getResultList().size());
|
||||
assertEquals(0, session.createSelectionQuery("select 1 where null is not distinct from 1").getResultList().size());
|
||||
assertEquals(0, session.createSelectionQuery("select 1 where null is not distinct from 0").getResultList().size());
|
||||
assertEquals(1, session.createSelectionQuery("select 1 where null is not distinct from null").getResultList().size());
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue