Commit ebc124b9e79177929659af9f9b8366771aa1983b

Thomas de Grivel 2024-09-29T22:39:35

Facts.add_tags test

diff --git a/test/ikc3/facts.kc3 b/test/ikc3/facts.kc3
index 096383a..12df14b 100644
--- a/test/ikc3/facts.kc3
+++ b/test/ikc3/facts.kc3
@@ -6,5 +6,9 @@ quote Facts.add_tags(db, 1, 2, 3)
 Facts.add_tags(db, 1, 2, 3)
 quote Facts.add_tags(db, 4, 5, 6)
 Facts.add_tags(db, 4, 5, 6)
-quote Facts.with_tags(db, s = ?, p = ?, o = ?, fn (fact) { puts(fact); :ok })
-Facts.with_tags(db, s = ?, p = ?, o = ?, fn (fact) { puts(fact); :ok })
+quote Facts.with_tags(db, s = ?, p = ?, o = ?, fn (fact) { puts("#{s} #{p} #{o}"); :ok })
+Facts.with_tags(db, s = ?, p = ?, o = ?, fn (fact) { puts("#{s} #{p} #{o}"); :ok })
+quote Facts.add_tags(db, 7, 8, 9)
+Facts.add_tags(db, 7, 8, 9)
+quote Facts.with_tags(db, s = ?, p = ?, o = ?, fn (fact) { puts("#{s} #{p} #{o}"); :ok })
+Facts.with_tags(db, s = ?, p = ?, o = ?, fn (fact) { puts("#{s} #{p} #{o}"); :ok })
diff --git a/test/ikc3/facts.out.expected b/test/ikc3/facts.out.expected
index cac7d62..1e2ba61 100644
--- a/test/ikc3/facts.out.expected
+++ b/test/ikc3/facts.out.expected
@@ -15,13 +15,17 @@ Facts.add_tags(db, 4, 5, 6)
        predicate: 5,
        object: 6,
        id: (Uw) 0}
-Facts.with_tags(db, s = ?, p = ?, o = ?, fn (fact) { puts(fact) ; :ok })
-%FactW{subject: 1,
-       predicate: 2,
-       object: 3,
-       id: (Uw) 0}
-%FactW{subject: 4,
-       predicate: 5,
-       object: 6,
+Facts.with_tags(db, s = ?, p = ?, o = ?, fn (fact) { puts("#{s} #{p} #{o}") ; :ok })
+1 2 3
+4 5 6
+:ok
+Facts.add_tags(db, 7, 8, 9)
+%FactW{subject: 7,
+       predicate: 8,
+       object: 9,
        id: (Uw) 0}
+Facts.with_tags(db, s = ?, p = ?, o = ?, fn (fact) { puts("#{s} #{p} #{o}") ; :ok })
+1 2 3
+4 5 6
+7 8 9
 :ok