Projekt

Obecné

Profil

« Předchozí | Další » 

Revize c95defa5

Přidáno uživatelem Vít Mazín před více než 5 roky(ů)

Missing vertex test

Zobrazit rozdíly:

sources/classes/test/imiger-dot-converter/incomplete2.dot
1
digraph "example.y"
2
{
3
  node [fontname = courier, shape = box, colorscheme = paired6]
4
  edge [fontname = courier]
5

  
6
  0 -> 1 [style=solid label="\"0\""]
7
  0 -> 2 [style=dashed label="exp"]
8
  0 -> 3 [style=dashed label="a"]
9
  0 -> 4 [style=dashed label="b"]
10
  1 [label="State 1\n\l  3 a: \"0\" .\l  4 b: \"0\" .\l"]
11
  1 -> "1R3" [style=solid]
12
 "1R3" [label="R3", fillcolor=3, shape=diamond, styale=filled]
13
  1 -> "1R4" [label="[\".\"]", style=solid]
14
 "1R4" [label="R4", fillcolor=3, shape=diamond, style=filled]
15
  2 [label="State 2\n\l  0 $accept: exp . $end\l"]
16
  2 -> 5 [style=solid label="$end"]
17
  3 [label="State 3\n\l  1 exp: a . \";\"\l"]
18
  3 -> 6 [style=solid label="\";\""]
19
  4 [label="State 4\n\l  2 exp: b . \".\"\l"]
20
  4 -> 7 [style=solid label="\".\""]
21
  5 [label="State 5\n\l  0 $accept: exp $end .\l"]
22
  5 -> "5R0" [style=solid]
23
 "5R0" [label="Acc", fillcolor=1, shape=diamond, style=filled]
24
  6 [label="State 6\n\l  1 exp: a \";\" .\l"]
25
  6 -> "6R1" [style=solid]
26
 "6R1" [label="R1", fillcolor=3, shape=diamond, style=filled]
27
  7 [label="State 7\n\l  2 exp: b \".\" .\l"]
28
  7 -> "7R2" [style=solid]
29
 "7R2" [label="R2", fillcolor=3, shape=diamond, style=filled]
30
}
sources/imiger-dot-converter/src/test/java/cz/zcu/kiv/imiger/plugin/dot/backend/PaypalDOTLoaderTest.java
61 61
        assertEquals(0, edges.size());
62 62
        assertEquals(0, attrs.size());
63 63
    }
64

  
65
    @Test
66
    public void missingVertexDefinitionTest() {
67
        String input = getFileAsString("incomplete2.dot");
68

  
69
        loader = new PaypalDOTLoader(input);
70

  
71
        List<VertexDTO> vertices = loader.getVertices();
72
        List<EdgeDTO> edges = loader.getEdges();
73
        Set<AttributeType> attrs = loader.getAttributeTypes();
74

  
75
        assertEquals(13, vertices.size());
76
        assertEquals(12, edges.size());
77
        assertEquals(5, attrs.size());
78
    }
64 79
}
sources/imiger-dot-converter/src/test/resources/incomplete2.dot
1
digraph "example.y"
2
{
3
  node [fontname = courier, shape = box, colorscheme = paired6]
4
  edge [fontname = courier]
5

  
6
  0 -> 1 [style=solid label="\"0\""]
7
  0 -> 2 [style=dashed label="exp"]
8
  0 -> 3 [style=dashed label="a"]
9
  0 -> 4 [style=dashed label="b"]
10
  1 [label="State 1\n\l  3 a: \"0\" .\l  4 b: \"0\" .\l"]
11
  1 -> "1R3" [style=solid]
12
 "1R3" [label="R3", fillcolor=3, shape=diamond, styale=filled]
13
  1 -> "1R4" [label="[\".\"]", style=solid]
14
 "1R4" [label="R4", fillcolor=3, shape=diamond, style=filled]
15
  2 [label="State 2\n\l  0 $accept: exp . $end\l"]
16
  2 -> 5 [style=solid label="$end"]
17
  3 [label="State 3\n\l  1 exp: a . \";\"\l"]
18
  3 -> 6 [style=solid label="\";\""]
19
  4 [label="State 4\n\l  2 exp: b . \".\"\l"]
20
  4 -> 7 [style=solid label="\".\""]
21
  5 [label="State 5\n\l  0 $accept: exp $end .\l"]
22
  5 -> "5R0" [style=solid]
23
 "5R0" [label="Acc", fillcolor=1, shape=diamond, style=filled]
24
  6 [label="State 6\n\l  1 exp: a \";\" .\l"]
25
  6 -> "6R1" [style=solid]
26
 "6R1" [label="R1", fillcolor=3, shape=diamond, style=filled]
27
  7 [label="State 7\n\l  2 exp: b \".\" .\l"]
28
  7 -> "7R2" [style=solid]
29
 "7R2" [label="R2", fillcolor=3, shape=diamond, style=filled]
30
}

Také k dispozici: Unified diff