Added checking for unresolved templates in CLI. Added test.

This commit is contained in:
Evgeny Gerashchenko
2012-06-20 18:04:17 +04:00
parent ccc8c77526
commit 0dd64837c0
5 changed files with 105 additions and 14 deletions
@@ -17,6 +17,7 @@
package org.jetbrains.jet.cli.jvm;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
import junit.framework.Assert;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.cli.common.ExitCode;
@@ -62,7 +63,8 @@ public class CliTest {
private void executeCompilerCompareOutput(@NotNull String[] args) {
try {
String actual = normalize(executeCompilerGrabOutput(args));
String actual = normalize(executeCompilerGrabOutput(args))
.replace(FileUtil.toSystemIndependentName(new File("compiler/testData/cli/").getAbsolutePath()), "$TESTDATA_DIR$");
String expected = normalize(FileUtil.loadFile(new File("compiler/testData/cli/" + testName.getMethodName() + ".out")));
@@ -103,7 +105,7 @@ public class CliTest {
@Test
public void help() throws Exception {
executeCompilerCompareOutput(new String[]{ "--help" });
executeCompilerCompareOutput(new String[] {"--help"});
}
@Test
@@ -111,4 +113,9 @@ public class CliTest {
executeCompilerCompareOutput(new String[]{ "-script", "compiler/testData/cli/script.ktscript", "hi", "there" });
}
@Test
public void ideTemplates() {
executeCompilerCompareOutput(new String[]{ "-src", "compiler/testData/cli/ideTemplates.kt", "-output", tmpdir.getTmpDir().getPath()});
}
}