コード例 #1
0
ファイル: ParserTest.java プロジェクト: bolinfest/moe-java
  public void testParseRepositoryExpression() throws Exception {
    testParseRepoExHelper("internal", new RepositoryExpression(new Term("internal", EMPTY_MAP)));

    testParseRepoExHelper(
        "internal(revision=1)", new RepositoryExpression("internal").atRevision("1"));

    testParseRepoExHelper(
        "file(path=\"/tmp\",projectSpace=internal)",
        new RepositoryExpression("file")
            .withOption("path", "/tmp")
            .withOption("projectSpace", "internal"));

    try {
      Parser.parseRepositoryExpression("internal(revision=1)>public");
      fail("Expression w/ translation should have failed parsing as RepositoryExpression.");
    } catch (ParseError expected) {
    }
  }
コード例 #2
0
ファイル: ParserTest.java プロジェクト: bolinfest/moe-java
 private void testParseRepoExHelper(String exString, RepositoryExpression ex) throws Exception {
   assertEquals(exString, ex.toString());
   assertEquals(ex, Parser.parseRepositoryExpression(exString));
 }