-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make lexgen more independent tool again
move packages to file for command line setting mkdir -p outdir
- Loading branch information
1 parent
67e9a6d
commit 63d34ff
Showing
5 changed files
with
125 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[ | ||
{ | ||
"package": "bsky", | ||
"prefix": "app.bsky", | ||
"outdir": "api/bsky", | ||
"import": "github.com/bluesky-social/indigo/api/bsky" | ||
}, | ||
{ | ||
"package": "atproto", | ||
"prefix": "com.atproto", | ||
"outdir": "api/atproto", | ||
"import": "github.com/bluesky-social/indigo/api/atproto" | ||
}, | ||
{ | ||
"package": "chat", | ||
"prefix": "chat.bsky", | ||
"outdir": "api/chat", | ||
"import": "github.com/bluesky-social/indigo/api/chat" | ||
}, | ||
{ | ||
"package": "ozone", | ||
"prefix": "tools.ozone", | ||
"outdir": "api/ozone", | ||
"import": "github.com/bluesky-social/indigo/api/ozone" | ||
} | ||
] |
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,19 @@ | ||
package lex | ||
|
||
import "testing" | ||
|
||
func TestParsePackages(t *testing.T) { | ||
text := `[{"package": "bsky", "prefix": "app.bsky", "outdir": "api/bsky", "import": "github.com/bluesky-social/indigo/api/bsky"}]` | ||
parsed, err := ParsePackages([]byte(text)) | ||
if err != nil { | ||
t.Fatalf("error parsing json: %s", err) | ||
} | ||
if len(parsed) != 1 { | ||
t.Fatalf("expected 1, got %d", len(parsed)) | ||
} | ||
expected := Package{"bsky", "app.bsky", "api/bsky", "github.com/bluesky-social/indigo/api/bsky"} | ||
if expected != parsed[0] { | ||
t.Fatalf("expected %#v, got %#v", expected, parsed[0]) | ||
} | ||
|
||
} |