package migl.lisp;

import static org.junit.Assert.fail;

import org.junit.Before;
import org.junit.Test;

public class LispParserOwnTest {

	private Lisp lisp;
	
	@Before
	public void init(){
		lisp = LispFactory.makeIntepreter();
	}
	
	@Test(expected = LispError.class)
	public void testMultiElementParser() throws LispError {
		lisp.parse("10 str");
	}
	
	@Test
	public void testExplode() {
		try {
			lisp.parse("(aze (10 5.8))");
		} catch (LispError e) {
			fail("Erreur pendant l'analyse");
		}
	}
	
	@Test(expected = LispError.class)
	public void testBadEndList() throws LispError {
		lisp.parse("(aze 158 8.6");
	}
	
	@Test(expected = LispError.class)
	public void testListandElementAfter() throws LispError {
		lisp.parse("(aze (aze rty)) aze");
	}

}
