From 08bcc47170bc6a9a7d5075249ccedb57713e3c10 Mon Sep 17 00:00:00 2001 From: David McKay Date: Tue, 24 Jul 2018 12:50:49 +0100 Subject: [PATCH] Resolve Local Dependencies From Bundle Path Fixes #22 --- stable/dep.pony | 2 +- stable/test/integration/test_env.pony | 4 ++-- stable/test/test_dep.pony | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/stable/dep.pony b/stable/dep.pony index 9360c09..98138a6 100644 --- a/stable/dep.pony +++ b/stable/dep.pony @@ -123,7 +123,7 @@ class DepLocal end fun root_path(): String => - local_path + Path.join(bundle.path.path, local_path) fun packages_path(): String => root_path() diff --git a/stable/test/integration/test_env.pony b/stable/test/integration/test_env.pony index 8558fb9..df4c0ab 100644 --- a/stable/test/integration/test_env.pony +++ b/stable/test/integration/test_env.pony @@ -108,7 +108,7 @@ class TestEnvBundleInSameDir is UnitTest let expected = try - "../local/a" + ":" + + Path.join(tmp.path, "../local/a") + ":" + tmp.join(".deps/-local-git-b16798852821555717647")?.path + ":" + tmp.join(".deps/github/c")?.path + ":" + tmp.join(".deps/gitlab/d")?.path @@ -193,7 +193,7 @@ class TestEnvBundleInParentDir is UnitTest ]}\n"), "prepare bundle.json") let notifier: ProcessNotify iso = _ExpectClient(h, - ["PONYPATH=../local/a"], + ["PONYPATH=" + Path.join(tmp.path, "../local/a")], None, 0) _Exec(h, "stable env", nested.path, consume notifier) diff --git a/stable/test/test_dep.pony b/stable/test/test_dep.pony index e646ae3..61edc3e 100644 --- a/stable/test/test_dep.pony +++ b/stable/test/test_dep.pony @@ -72,8 +72,9 @@ class TestDep is UnitTest info = JsonObject.from_map(local) dep = Dep(bundle, info)? - h.assert_eq[String]("../foo/bar", dep.root_path()) - h.assert_eq[String]("../foo/bar", dep.packages_path()) + + h.assert_eq[String](Path.join(bundle.path.path, "../foo/bar"), dep.root_path()) + h.assert_eq[String](Path.join(bundle.path.path, "../foo/bar"), dep.packages_path()) let incomplete_local = Map[String, JsonType] incomplete_local("type") = "local"