Skip to content

Commit

Permalink
update JassTest
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianWege committed Feb 24, 2019
1 parent 0018343 commit 9ccae0e
Show file tree
Hide file tree
Showing 2 changed files with 16,067 additions and 17 deletions.
71 changes: 54 additions & 17 deletions src/test/java/wc3libs/txt/JassTest.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
package wc3libs.txt;

import net.moonlightflower.wc3libs.txt.Jass;
import net.moonlightflower.wc3libs.bin.app.W3I;
import net.moonlightflower.wc3libs.port.JMpqPort;
import net.moonlightflower.wc3libs.txt.app.jass.*;
import org.testng.annotations.Test;
import wc3libs.misc.Wc3LibTest;

import java.io.File;
import java.io.IOException;
import java.io.*;
import java.nio.charset.StandardCharsets;

import static org.testng.Assert.assertFalse;


public class JassTest extends Wc3LibTest {

@Test
@Test()
public void testRebuild() throws IOException {
File file = getFile("jass/compiled.j");

Expand All @@ -30,30 +32,65 @@ public void testRebuild2() throws IOException {
assertFalse(System.err.checkError());
}

/*@Test()
@Test()
public void testRebuild3() throws IOException {
File file = getFile("jass/inventorySys.j");
File file = getFile("jass/compiled2.j");

Jass jass = new Jass(file);
LightJass jass = new LightJass(file);

assertFalse(System.err.checkError());
JassScript script = new JassScript(jass.getRootContext());

StringWriter sw = new StringWriter();

script.write(sw);

System.out.println(sw.toString());

/*Jass newJass = new Jass(sw.toString());
assertFalse(System.err.checkError());*/
}

@Test()
public void testRebuild4() throws IOException {
File file = getFile("jass/League.j");
public void testRebuildDwc() throws IOException {
File file = getFile("jass/dwc.j");

Jass jass = new Jass(file);
LightJass jass = new LightJass(file);

assertFalse(System.err.checkError());
jass.getRootContext();

JassScript script = new JassScript(jass.getRootContext());

StringWriter sw = new StringWriter();

script.write(sw);

Jass newJass = new Jass(sw.toString());
}

@Test()
public void testRebuild5() throws IOException {
File file = getFile("jass/dota.j");
public void injectW3IConfigs() throws IOException {
File file = getFile("jass/dwc.j");

Jass jass = new Jass(file);
LightJass jass = new LightJass(file);

assertFalse(System.err.checkError());
}*/
jass.getRootContext();

JassScript script = new JassScript(jass.getRootContext());

W3I w3i = new W3I();

w3i.setMapName("mapName");
w3i.setMapAuthor("mapAuthor");
w3i.setMapDescription("description");
w3i.setPlayersRecommendedAmount("playersRecommended");

w3i.injectConfigsInJassScript(script);

StringWriter sw = new StringWriter();

script.write(sw);

Jass newJass = new Jass(sw.toString());
}
}
Loading

0 comments on commit 9ccae0e

Please sign in to comment.