Skip to content

Instantly share code, notes, and snippets.

@gonzalezgarciacristian
Created March 8, 2017 11:07
Show Gist options
  • Save gonzalezgarciacristian/5e421d6d6c83f39f46711091fdc7b766 to your computer and use it in GitHub Desktop.
Save gonzalezgarciacristian/5e421d6d6c83f39f46711091fdc7b766 to your computer and use it in GitHub Desktop.
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