Ignore:
Timestamp:
03/17/06 10:13:30 (19 years ago)
Author:
remar
Message:
  • parser now understands strings and doesn't try to parse contents of 'em
  • elmir was really tired when he did the test for the parser, so it's been fixed
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/org.modelica.mdt.test/src/org/modelica/mdt/test/TestModelicaParser.java

    r435 r437  
    142142
    143143    private static final String GET_CLASS_INFO1 =
    144         "{\"model\"," +
    145         "\"Chua's circuit, ns, V, A\"," +
    146         "C:\\OpenModelica132\\ModelicaLibrary\\Modelica\\Electrical\\Anal" +
    147         "og\\Examples\\ChuaCircuit.mo\"," +
    148         "{false,false,true}," +
    149         "{\"writable\",1,1,65,16}}";
    150 
     144    "{\"model\",\"Chua's circuit, ns, V, A\",\"/home/x05andre/ex/Modelica " +
     145    "Library/Modelica/Electrical/Analog/Examples/ChuaCircuit.mo\",{false,f" +
     146    "alse,true},{\"writable\",1,1,65,16}}";
    151147    /*
    152148     * The expected results when getElements() output is parsed
     
    414410
    415411        parsedList = ModelicaParser.parseList(GET_CLASS_INFO1);
    416        
    417         assertEquals("parse resuls if of wrong length", 4, parsedList.size());
     412
     413        assertEquals("Parse resuls is of wrong length", 5, parsedList.size());
    418414       
    419415        listElement = parsedList.elementAt(0);
    420         assertTrue("expected simple element found list",
    421                 listElement instanceof Element);
    422         assertEquals("wrong string", "\"model\"",
     416        assertTrue("Expected simple element found list",
     417                listElement instanceof Element);
     418        assertEquals("Wrong string", "\"model\"",
    423419                ((Element)listElement).toString());
    424420
     
    426422        assertTrue("expected simple element found list",
    427423                listElement instanceof Element);
    428         assertEquals("wrong string",
    429                 "Chua's circuit, ns, V, A\",\"C:\\OpenModelica132\\Modelica" +
    430                 "Library\\Modelica\\Electrical\\Analog\\Examples\\ChuaCircuit.mo",
    431                 ((Element)listElement).toString());
    432 
     424        assertEquals("Wrong string",
     425                "\"Chua's circuit, ns, V, A\"",
     426                ((Element)listElement).toString());
    433427       
    434428        listElement = parsedList.elementAt(2);
    435         assertTrue("expected list found simple element",
    436                 listElement instanceof List);
    437         list = (List)listElement;
    438        
    439         assertEquals("parse resuls if of wrong length", 3, parsedList.size());
    440        
    441         listElement = list.elementAt(0);
    442         assertTrue("expected simple element found list",
    443                 listElement instanceof Element);
    444         assertEquals("wrong string", "false",
    445                 ((Element)listElement).toString());
    446        
    447         listElement = list.elementAt(1);
    448         assertTrue("expected simple element found list",
    449                 listElement instanceof Element);
    450         assertEquals("wrong string", "false",
    451                 ((Element)listElement).toString());
    452        
    453         listElement = list.elementAt(2);
    454         assertTrue("expected simple element found list",
    455                 listElement instanceof Element);
    456         assertEquals("wrong string", "true",
    457                 ((Element)listElement).toString());
    458 
    459 
     429        assertTrue("Expected simple element found list",
     430                listElement instanceof Element);
     431        assertEquals("Wrong string",
     432                "\"/home/x05andre/ex/Modelica Library/Modelica/Electrical/Anal" +
     433                "og/Examples/ChuaCircuit.mo\"",
     434                ((Element)listElement).toString());
     435       
    460436        listElement = parsedList.elementAt(3);
    461437        assertTrue("expected list found simple element",
     
    463439        list = (List)listElement;
    464440       
    465         assertEquals("parse resuls if of wrong length", 5, parsedList.size());
     441        assertEquals("parse resuls if of wrong length", 3, list.size());
    466442       
    467443        listElement = list.elementAt(0);
    468444        assertTrue("expected simple element found list",
    469445                listElement instanceof Element);
    470         assertEquals("wrong string", "writeable",
     446        assertEquals("wrong string", "false",
     447                ((Element)listElement).toString());
     448       
     449        listElement = list.elementAt(1);
     450        assertTrue("expected simple element found list",
     451                listElement instanceof Element);
     452        assertEquals("wrong string", "false",
     453                ((Element)listElement).toString());
     454       
     455        listElement = list.elementAt(2);
     456        assertTrue("expected simple element found list",
     457                listElement instanceof Element);
     458        assertEquals("wrong string", "true",
     459                ((Element)listElement).toString());
     460
     461
     462        listElement = parsedList.elementAt(4);
     463        assertTrue("expected list found simple element",
     464                listElement instanceof List);
     465        list = (List)listElement;
     466       
     467        assertEquals("parse resuls if of wrong length", 5, list.size());
     468       
     469        listElement = list.elementAt(0);
     470        assertTrue("expected simple element found list",
     471                listElement instanceof Element);
     472        assertEquals("wrong string", "\"writable\"",
    471473                ((Element)listElement).toString());
    472474       
Note: See TracChangeset for help on using the changeset viewer.