File tree Expand file tree Collapse file tree 4 files changed +62
-19
lines changed
liquidjava-verifier/src/test/java/liquidjava/rj_language/opt Expand file tree Collapse file tree 4 files changed +62
-19
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 44import static org .junit .jupiter .api .Assertions .assertTrue ;
55
66/**
7- * Testa o método LiteralBoolean devolve a string "true" quando o valor booleano interno é verdadeiro
8- */
7+ * Testa o método LiteralBoolean devolve a string "true" quando o valor booleano interno é verdadeiro
8+ */
99
1010class LiteralBooleanSimplestTest {
1111
Original file line number Diff line number Diff line change 22
33import org .junit .jupiter .api .Test ;
44import static org .junit .jupiter .api .Assertions .assertEquals ;
5+
56/**
6- * Testa se o método LiteralInt devolve o número em formato de texto
7- */
7+ * Testa se o método LiteralInt devolve o número em formato de texto
8+ */
89
910class TestLiteralInt {
1011
11- @ Test
12+ @ Test
1213 void testToStringReturnsNumber () {
1314 assertEquals ("42" , new LiteralInt (42 ).toString ());
1415 }
Original file line number Diff line number Diff line change 1+ package liquidjava .api .tests ;
2+
3+ import static org .junit .Assert .fail ;
4+
5+ import liquidjava .api .CommandLineLauncher ;
6+ import liquidjava .errors .ErrorEmitter ;
7+ import org .junit .Test ;
8+
9+ /**
10+ * Este teste chama o CommandLineLauncher e verifica se o ErrorEmitter reporta corretamente os resultados para ficheiros
11+ * conhecidos.
12+ */
13+ public class TesteIntegração {
14+
15+ /**
16+ * Testa a verificação de um ficheiro que se espera estar correto. Este teste falha se o ErrorEmitter encontrar um
17+ * erro de Refinement.
18+ */
19+ @ Test
20+ public void testVerification_CorrectFile () {
21+ String correctFilePath = "../liquidjava-example/src/main/java/testSuite/SimpleTest.java" ;
22+ ErrorEmitter errorEmitter = CommandLineLauncher .launch (correctFilePath );
23+
24+ if (errorEmitter .foundError ()) {
25+ System .out .println (
26+ "ERROR: O ficheiro " + correctFilePath + " deveria estar correto, mas foi encontrado um erro." );
27+ fail ();
28+ }
29+ }
30+
31+ /**
32+ * Testa a verificação de um ficheiro que se espera conter um erro. Este teste falha se o ErrorEmitter não encontrar
33+ * um erro de Refinement.
34+ */
35+ @ Test
36+ public void testVerification_ErrorFile () {
37+ String errorFilePath = "../liquidjava-example/src/main/java/testSuite/ErrorArithmetic.java" ;
38+
39+ ErrorEmitter errorEmitter = CommandLineLauncher .launch (errorFilePath );
40+
41+ if (!errorEmitter .foundError ()) {
42+ System .out .println (
43+ "ERROR: O ficheiro " + errorFilePath + " deveria conter um erro, mas passou na verificação." );
44+ fail ();
45+ }
46+ }
47+
48+ /**
49+ * Testa se a execução do método principal de CommandLineLauncher sem argumentos arranca sem lançar exceções
50+ */
51+ @ Test
52+ public void testMainWithNoArguments () {
53+ CommandLineLauncher .main (new String [] {});
54+ }
55+
56+ }
You can’t perform that action at this time.
0 commit comments