package test;

import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import javax.script.ScriptException;
import org.clafer.ast.AstModel;
import org.clafer.collection.Triple;
import org.clafer.compiler.ClaferCompiler;
import org.clafer.compiler.ClaferSolver;
import org.clafer.javascript.Javascript;
import org.clafer.objective.Objective;
import org.clafer.scope.Scope;
import static org.junit.Assert.*;
import org.junit.Test;

/**
 *
 * @author jimmy
 */
public class PositiveTest {

    @Test
    public void testPositives() throws IOException, ScriptException, URISyntaxException {
        File dir = new File(PositiveTest.class.getResource("/positive").toURI());
        assertTrue(dir.isDirectory());

        for (File test : dir.listFiles()) {
            Triple<AstModel, Scope, Objective[]> p = Javascript.readModel(test);
            ClaferSolver s = ClaferCompiler.compile(p.getFst(), p.getSnd());

            assertTrue(test + " failed", s.find());
        }
    }
}

@@ -982,24 +982,93 @@
  s.find());%0A
+            for (int i = 0; i %3C 10 && s.find(); i++) %7B%0A            %7D%0A
         %7D%0A  

Test more upto 11 instances for the positive tests.