This repository has been archived by the owner on Jan 5, 2019. It is now read-only.
forked from emicklei/proto
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Ernest Micklei
authored and
Ernest Micklei
committed
Jan 27, 2017
1 parent
0261da8
commit 26596d2
Showing
16 changed files
with
153 additions
and
94 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package proto3parser | ||
|
||
type Package struct { | ||
Name string | ||
} | ||
|
||
func (a *Package) parse(p *Parser) error { | ||
return nil | ||
} |
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
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
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,31 @@ | ||
package proto3parser | ||
|
||
import ( | ||
"strings" | ||
"testing" | ||
) | ||
|
||
func TestService(t *testing.T) { | ||
proto := `service AccountService {}` | ||
stmt, err := NewParser(strings.NewReader(proto)).Parse() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
if got, want := stmt.Services[0].Name, "AccountService"; got != want { | ||
t.Errorf("got [%v] want [%v]", got, want) | ||
} | ||
} | ||
|
||
func TestServiceWithRPCs(t *testing.T) { | ||
proto := `service AccountService { | ||
rpc CreateAccount (CreateAccount) returns (ServiceFault) {} | ||
rpc GetAccount (Int64) returns (Account) {} | ||
}` | ||
stmt, err := NewParser(strings.NewReader(proto)).Parse() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
if got, want := len(stmt.Services[0].RPCalls), 2; got != want { | ||
t.Errorf("got [%v] want [%v]", got, want) | ||
} | ||
} |
Oops, something went wrong.