Changeset 2256


Ignore:
Timestamp:
Jan 20, 2007, 4:14:06 PM (14 years ago)
Author:
roman
Message:

The check for hardness of format and hard expressions

Location:
devel-tools/trunk/eclipse/org.refal.plus.comp.test/src/org/refal/plus/comp/test
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • devel-tools/trunk/eclipse/org.refal.plus.comp.test/src/org/refal/plus/comp/test/EolTest.java

    r2254 r2256  
    1111
    1212import org.junit.After;
    13 import org.junit.AfterClass;
    1413import org.junit.Before;
    15 import org.junit.BeforeClass;
    1614import org.junit.Test;
    1715
  • devel-tools/trunk/eclipse/org.refal.plus.comp.test/src/org/refal/plus/comp/test/FenceAndCutCheckerTest.java

    r2254 r2256  
    11package org.refal.plus.comp.test;
    22
    3 import static org.junit.Assert.assertEquals;
    43import static org.junit.Assert.assertTrue;
    54
  • devel-tools/trunk/eclipse/org.refal.plus.comp.test/src/org/refal/plus/comp/test/ParserTest.java

    r2254 r2256  
    77import org.junit.Before;
    88import org.junit.Test;
     9import org.refal.plus.comp.MsgCode;
    910import org.refal.plus.comp.ast.AstImplem;
    1011import org.refal.plus.comp.ast.AstInterf;
     
    3940                String actual = imageBuilder.toString();
    4041                assertEquals("AST is OK", expected, actual);
     42        }
     43
     44        public void implem(String input, MsgCode msgCode) {
     45                MsgAccumulator msgAcc = new MsgAccumulator();
     46                @SuppressWarnings("unused")
     47                AstImplem astImplem = Util.parseImplemString(input, msgAcc);
     48                Util.checkMsg(msgAcc, msgCode);
    4149        }
    4250
     
    170178                                "F\\{,A:{,$fail;A,;}:{A,1;B,2;}::sX,sX;};");
    171179        }
     180       
     181        @Test
     182        public void hardnessCheck() {
     183                implem("$func F A e B v C =;", MsgCode.SeveralSoftVariablesAtTheSameLevel);
     184                implem("F , A :: A (A e B v C) B,", MsgCode.SeveralSoftVariablesAtTheSameLevel);
     185        }
    172186}
  • devel-tools/trunk/eclipse/org.refal.plus.comp.test/src/org/refal/plus/comp/test/VariableScopeCheckerTest.java

    r2249 r2256  
    4545                vsc.visit(astFuncDef.body, new LexicalEnvironment<VarType>(null));
    4646                return msgAcc;
     47        }
     48
     49        private static void expectMessage(String input, MsgCode msgCode) {
     50                MsgAccumulator msgAcc = parseAndReturnMessages(input);
     51                Util.checkMsg(msgAcc, msgCode);
    4752        }
    4853
     
    155160                expectOK("F {eX , {eX;eX;};};");
    156161                expectOK("F {eX , eX:{eX = eX;};};");
     162               
     163                expectMessage("F = s;", MsgCode.AVariableWithoutIndexInResultExpression);
     164                expectOK("F tX, tX tX :: t tY, tX tY;");
     165                expectOK("F tX, tX tX $iter tY tY :: t tY, tX tY;");
     166                expectOK("F tX t, tX tX : tY t, tX tY;");
     167                expectOK("F tX t, tX tX : {tY t, tX tY;};");
    157168        }
    158169
Note: See TracChangeset for help on using the changeset viewer.