Skip to content

Commit a24b010

Browse files
authored
Merge pull request #94 from integr8rs/unit-test-multiple-escaped-segments
Add unit-test for #91 question marks are not parsed correctly
2 parents dfe7391 + 2538b63 commit a24b010

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/EDITest/ParserTest.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,35 @@ public function testEscapedSegment()
6363
$this->assertSame($expected, $result);
6464
}
6565

66+
/** @dataProvider multipleEscapedSegmentsProvider */
67+
public function testMultipleEscapedSegments($string,$expected)
68+
{
69+
$result = (new Parser($string))->get();
70+
$this->assertSame($expected,$result);
71+
}
72+
73+
public function multipleEscapedSegmentsProvider()
74+
{
75+
return [
76+
["EQD+CX??DU12?+3456+2?:0'", [["EQD", "CX?DU12+3456", "2:0"]]],
77+
["EQD+CX????DU12?+3456+2?:0'", [["EQD", "CX??DU12+3456", "2:0"]]],
78+
["EQD+CX??????DU12?+3456+2?:0'", [["EQD", "CX???DU12+3456", "2:0"]]],
79+
["EQD+CX????????DU12?+3456+2?:0'",[["EQD", "CX????DU12+3456", "2:0"]]],
80+
["EQD+CX??DU12?+3456+2?:0??'", [["EQD", "CX?DU12+3456", "2:0?"]]],
81+
["EQD+CX??DU12?+3456+2?:0????'", [["EQD", "CX?DU12+3456", "2:0??"]]],
82+
["EQD+CX??DU12?+3456+2?:0??????'",[["EQD", "CX?DU12+3456", "2:0???"]]],
83+
["??EQD+CX??DU12?+3456+2?:0'", [["?EQD", "CX?DU12+3456", "2:0"]]],
84+
["????EQD+CX??DU12?+3456+2?:0'", [["??EQD", "CX?DU12+3456", "2:0"]]],
85+
["??????EQD+CX??DU12?+3456+2?:0'",[["???EQD", "CX?DU12+3456", "2:0"]]],
86+
["EQD??+CX??DU12?+3456+2?:0'", [["EQD?", "CX?DU12+3456", "2:0"]]],
87+
["EQD????+CX??DU12?+3456+2?:0'", [["EQD??", "CX?DU12+3456", "2:0"]]],
88+
["EQD??????+CX??DU12?+3456+2?:0'",[["EQD???", "CX?DU12+3456", "2:0"]]],
89+
["EQD+??CX??DU12?+3456+2?:0'", [["EQD", "?CX?DU12+3456", "2:0"]]],
90+
["EQD+????CX??DU12?+3456+2?:0'", [["EQD", "??CX?DU12+3456", "2:0"]]],
91+
["EQD+??????CX??DU12?+3456+2?:0'",[["EQD", "???CX?DU12+3456", "2:0"]]],
92+
];
93+
}
94+
6695
public function testFileOk()
6796
{
6897
$string = file_get_contents(__DIR__ . '/../files/example_order_ok.edi');

0 commit comments

Comments
 (0)