This repository has been archived by the owner on May 13, 2020. It is now read-only.
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
18 changed files
with
169 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
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 |
---|---|---|
@@ -1 +1 @@ | ||
0.1.3 | ||
0.1.4 |
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,7 @@ | ||
use "ponytest" | ||
|
||
actor Main is TestList | ||
new create(env: Env) => PonyTest(env, this) | ||
|
||
fun tag tests(test: PonyTest) => | ||
test(TestBundle) |
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,51 @@ | ||
use "ponytest" | ||
use "files" | ||
use ".." | ||
|
||
class TestBundle is UnitTest | ||
new iso create() => None | ||
fun name(): String => "stable.Bundle" | ||
|
||
fun bundle(subpath: String): String => | ||
Path.join("stable/test/testdata", subpath).string() | ||
|
||
fun apply(h: TestHelper) ? => | ||
h.assert_error(_BundleCreate(h.env, "notfound")?, "nonexistant directory") | ||
h.assert_error(_BundleCreate(h.env, bundle("empty"))?, "no bundle.json") | ||
h.assert_error(_BundleCreate(h.env, bundle("bad/empty"))?, "empty bundle.json") | ||
h.assert_error(_BundleCreate(h.env, bundle("bad/wrong_format"))?, "wrong bundle.json") | ||
|
||
h.assert_no_error(_BundleCreate(h.env, bundle("empty-deps"))?, "empty deps") | ||
h.assert_no_error(_BundleCreate(h.env, bundle("github"))?, "github dep") | ||
h.assert_no_error(_BundleCreate(h.env, bundle("local-git"))?, "local-git dep") | ||
h.assert_no_error(_BundleCreate(h.env, bundle("local"))?, "local dep") | ||
|
||
h.assert_no_error(_BundleCreate(h.env, bundle("abitofeverything"))?, "mixed deps") | ||
|
||
h.assert_error(_BundleCreate(h.env, "notfound", true)?, "create in nonexistant directory") | ||
|
||
h.assert_no_error(_BundleCreate(h.env, bundle("empty"), true)?, "create in directory with no bunde.json") | ||
|
||
let file = FilePath(h.env.root as AmbientAuth, bundle("empty/bundle.json"))? | ||
h.assert_true(file.exists(), "empty bundle.json created") | ||
let f = OpenFile(file) as File | ||
let content: String = f.read_string(f.size()) | ||
h.assert_eq[String]("{\"deps\":[]}\n", content) | ||
|
||
fun tear_down(h: TestHelper) => | ||
let created_bundle = bundle("empty/bundle.json") | ||
try | ||
FilePath(h.env.root as AmbientAuth, created_bundle)?.remove() | ||
else | ||
h.log("failed to clean up " + created_bundle) | ||
end | ||
|
||
class _BundleCreate is ITest | ||
let path: FilePath | ||
let create_missing: Bool | ||
|
||
new create(env': Env val, path': String, create': Bool = false) ? => | ||
path = FilePath(env'.root as AmbientAuth, path')? | ||
create_missing = create' | ||
|
||
fun apply() ? => Bundle(path, LogNone, create_missing)? |
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,5 @@ | ||
{"deps":[ | ||
{"repo":"foo/bar","type":"github"}, | ||
{"local-path":"../foo","type":"local-git"}, | ||
{"local-path":"../bar","type":"local"} | ||
]} |
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 @@ | ||
{} |
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 @@ | ||
{"repo":"foo/bar","type":"github"} |
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 @@ | ||
{"deps":[]} |
Empty file.
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 @@ | ||
{"deps":[{"repo":"foo/bar","type":"github","subdir":"baz","tag":"v1"}]} |
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 @@ | ||
{"deps":[{"local-path":"../foo","type":"local-git","tag":"v0"}]} |
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 @@ | ||
{"deps":[{"local-path":"../foo","type":"local"}]} |