]> Repositorios git - scryer-prolog.git/commitdiff
add #2341 test to lib_machine.rs
authorMark <[email protected]>
Thu, 29 Feb 2024 22:12:58 +0000 (15:12 -0700)
committerMark <[email protected]>
Thu, 29 Feb 2024 22:12:58 +0000 (15:12 -0700)
src/machine/lib_machine.rs

index 0bebfdc386184d83c55e52ee4c90f7270079bf60..d65fc53930bfceaaf8b7a436aa7e1282b5535a2b 100644 (file)
@@ -609,4 +609,25 @@ mod tests {
             Err(String::from("error existence_error procedure / non_existent_predicate 3 / non_existent_predicate 3"))
         );
     }
+
+    #[test]
+    fn issue_2341() {
+        let mut machine = Machine::new_lib();
+
+        machine.load_module_string(
+            "facts",
+            String::from(
+                r#"
+                male(stephen).
+                parent(albert,edward).
+                father(F,C):-parent(F,C),male(F).
+        "#,
+            ),
+        );
+
+        let query = String::from(r#"father(F,C)."#);
+        let output = machine.run_query(query);
+
+        assert_eq!(output, Ok(QueryResolution::False));
+    }
 }