-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
34 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
java/src/test/java/thriftlabs/thriftparser/integration/ParseIntegrationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package thriftlabs.thriftparser.integration; | ||
|
||
import java.util.List; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import thriftlabs.thriftparser.Thrift; | ||
import thriftlabs.thriftparser.ThriftParser; | ||
|
||
public class ParseIntegrationTest { | ||
|
||
public static String content = "include \"./other.thrift\" \n" + | ||
"namespace py demo_thrift\n" + | ||
"namespace go demo_thrift\n" + | ||
"namespace java thriftlabs.thriftxx.demo_thrift\n" + | ||
"\n" + | ||
"const string __VERSION__ = \"0.0.8\"\n" + | ||
"\n" + | ||
"struct DemoStruct {" + | ||
"1: required string x1;" + | ||
"}"; | ||
|
||
@Test | ||
public void testThrift() { | ||
Thrift.ParserResult td = Thrift.parse(content); | ||
List<ThriftParser.HeaderContext> headers = td.document.header(); | ||
assertEquals(headers.size(), 4); | ||
} | ||
} |