@@ -2,8 +2,10 @@ package io.github.kelvindev15.dsl
22
33import  io .github .kelvindev15 .prolog .PrologProgram 
44import  io .github .kelvindev15 .prolog .core .Constant .Atom 
5- import  io .github .kelvindev15 .prolog .core .{Constant , Struct , Variable }
5+ import  io .github .kelvindev15 .prolog .core .Goals .Conjunction 
6+ import  io .github .kelvindev15 .prolog .core .PrologList .Cons 
67import  io .github .kelvindev15 .prolog .core .Struct .{Directive , Fact , Rule }
8+ import  io .github .kelvindev15 .prolog .core .{Constant , PrologList , Struct , Variable }
79import  io .github .kelvindev15 .prolog .dsl .{DeclarativeDSL , PrologDSL }
810import  org .scalatest .funsuite .AnyFunSuite 
911import  org .scalatest .matchers .should .Matchers 
@@ -61,3 +63,13 @@ class TestDeclarativeDSL extends AnyFunSuite with Matchers with PrologDSL with D
6163          Struct (Atom (" is" 
6264            Constant .Numeric (2.5 ), Struct (Atom (" +" Variable (" X" Variable (" Y" 
6365    )
66+ 
67+   test(" Setting the goal of a prolog program" : 
68+     prolog {
69+       solve {
70+         && (2  is X  +  Y , (head(H ) |  T ) `=` S )
71+       }
72+     }.goal shouldBe Some (Conjunction (
73+       Struct (Atom (" is" Constant .Numeric (2 ), Struct (Atom (" +" Variable (" X" Variable (" Y" 
74+       Struct (Atom (" =" Cons (Variable (" H" Variable (" T" Variable (" S" 
75+     ))
0 commit comments