This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 5b8a8c09686cade47a1820f628c59b5b306aed86
Author: Paul King <[email protected]>
AuthorDate: Wed Nov 29 18:09:20 2023 +1000

    GROOVY-11238: Logical implication operator revisited (additional test case)
---
 .../groovy/operator/ImplicationOperatorTest.groovy | 40 ++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/src/test/groovy/operator/ImplicationOperatorTest.groovy 
b/src/test/groovy/operator/ImplicationOperatorTest.groovy
new file mode 100644
index 0000000000..b3b95d11d4
--- /dev/null
+++ b/src/test/groovy/operator/ImplicationOperatorTest.groovy
@@ -0,0 +1,40 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package operator
+
+import groovy.test.GroovyTestCase
+
+/**
+ * Test Logical Implication Operation
+ */
+class ImplicationOperatorTest extends GroovyTestCase {
+
+    void testImplicationOperation() {
+        assert false ==> false
+        assert false ==> true
+        assert !(true ==> false)
+        assert true ==> true
+    }
+
+    void testImplicationIsRightAssociative() {
+        assert false ==> false ==> false
+        assert false ==> (false ==> false)
+        assert !((false ==> false) ==> false)
+    }
+}

Reply via email to