package be.jeffcheasey88.peeratcode.parser.java;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.Arrays;
import java.util.regex.Pattern;

import org.junit.jupiter.api.Test;

import be.jeffcheasey88.peeratcode.parser.java.CleanerPool.Cleaner;

public class CleanerTest {

	@Test
	void cutter(){
		CleanerPool cleaner = new CleanerPool();
		String result = cleaner.clean("Test0<  List< Map< Test1, List<  Test2 >, Test3>> > ");
		assertEquals("Test0$TEST3 ", result);
	}
	
	@Test
	void sameOpenClose(){
		CleanerPool cleaner = new CleanerPool(new Cleaner("STRINGS",'"','"'));
		String result = cleaner.clean("Pattern.compile(\"^\\s*(import\\s+([^;]*);).*$\");");
		assertEquals("Pattern.compile($STRINGS0);", result);
	}
}
