package net.arnx.wmf2svg;

import java.io.File;
import java.io.FileFilter;

import org.junit.Test;

public class MainTest {
	@Test
	public void testMain() {
		System.setProperty("java.util.logging.config.file", "./logging.properties");

		File dir = new File(System.getProperty("user.home"), "home/wmf2svg");
		File[] files = dir.listFiles(new FileFilter() {
			public boolean accept(File file) {
				return file.getName().toLowerCase().endsWith(".wmf");
			}
		});

		for (int i = 0; i < files.length; i++) {
			String wmf = files[i].getAbsolutePath();
			String svg = wmf.substring(0, wmf.length() - 4) + ".svg";
			System.out.println(wmf + " transforming...");
			Main.main(new String[] {"-debug", "-replace-symbol-font", wmf, svg});
		}
	}
}

@@ -460,16 +460,106 @@
 %0A%09%09%7D);%0A%0A
+%09%09File outdir = new File(System.getProperty(%22user.home%22), %22wmf2svg%22);%0A%09%09outdir.mkdirs();%0A%0A
 %09%09for (i
@@ -657,28 +657,75 @@
 g = 
-wmf.substring(0, wmf
+new File(outdir, files%5Bi%5D.getName().substring(0, files%5Bi%5D.getName()
 .len
@@ -743,16 +743,35 @@
 + %22.svg%22
+).getAbsolutePath()
 ;%0A%09%09%09Sys

update MainTest