Created
March 8, 2017 11:07
-
-
Save gonzalezgarciacristian/5e421d6d6c83f39f46711091fdc7b766 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tests; | |
import static org.junit.Assert.assertEquals; | |
import org.junit.Test; | |
import analizador.Lexico; | |
public class LexicoTestsUnit { | |
Lexico lexico; | |
public LexicoTestsUnit() { | |
lexico = new Lexico(); | |
} | |
@Test | |
public void testIgual() { | |
assertEquals(lexico.analizarToken(Lexico.TOKEN_IGUAL), '='); | |
} | |
@Test | |
public void testSlash() { | |
assertEquals(lexico.analizarToken(Lexico.TOKEN_SLASH), '/'); | |
} | |
@Test | |
public void testBarraInvertida() { | |
assertEquals(lexico.analizarToken(Lexico.TOKEN_BARRA_INVERTIDA), '\''); | |
} | |
@Test | |
public void testMenorQue() { | |
assertEquals(lexico.analizarToken(Lexico.TOKEN_MENOR_QUE), '<'); | |
} | |
@Test | |
public void testMayorQue() { | |
assertEquals(lexico.analizarToken(Lexico.TOKEN_MAYOR_QUE), '>'); | |
} | |
@Test | |
public void testMenos() { | |
assertEquals(lexico.analizarToken(Lexico.TOKEN_MENOS), '-'); | |
} | |
@Test | |
public void testMas() { | |
assertEquals(lexico.analizarToken(Lexico.TOKEN_MAS), '+'); | |
} | |
@Test | |
public void testDefault() { | |
assertEquals(lexico.analizarToken(13), ' '); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment