From 632f3d0340f66977fd59bb8d0a601a430dd3d0f5 Mon Sep 17 00:00:00 2001 From: Christopher Vogt Date: Sat, 18 Feb 2017 00:59:36 +0000 Subject: simplify and add features to reflective task lookup code Code is much simpler now. Now cbt sub-tasks are separated by . instead of spaces to unify the syntax with method calls Scala. Also the reflective code now works not only on builds but any kind of values, so zero argument members of any types of return values can simply be called. This is also a large step towards detangling the reflective lookup from cbt and turning it into a fully fletched shell to Scala "native" call solution. --- test/test.scala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/test.scala b/test/test.scala index d8714c0..5359029 100644 --- a/test/test.scala +++ b/test/test.scala @@ -68,8 +68,8 @@ object Main{ logger.test(res.toString) val debugToken = "usage " ++ path ++ " " assertSuccess(res,debugToken) - assert(res.out == "", debugToken ++ res.toString) - assert(res.err contains usageString, debugToken ++ res.toString) + //assert(res.out == "", res.err.toString) + assert(res.out contains usageString, usageString + " not found in " ++ res.toString) } def compile(path: String)(implicit logger: Logger) = task("compile", path) def task(name: String, path: String)(implicit logger: Logger) = { @@ -85,11 +85,11 @@ object Main{ val debugToken = "\n"++lib.red("Deleting") ++ " " ++ (cbtHome ++("/test/"++path++"/target")).toPath.toAbsolutePath.toString++"\n" val debugToken2 = "\n"++lib.red("Deleting") ++ " " ++ (cbtHome ++("/test/"++path)).toPath.toAbsolutePath.toString++"\n" assertSuccess(res,debugToken) - assert(res.out == "", debugToken ++ " " ++ res.toString) - assert(res.err.contains(debugToken), debugToken ++ " " ++ res.toString) + assert(res.out == "", "should be empty: " + res.out) + assert(res.err.contains(debugToken), debugToken ++ " missing from " ++ res.err.toString) assert( !res.err.contains(debugToken2), - "Tried to delete too much: " ++ debugToken2 ++ " " ++ res.toString + "Tried to delete too much: " ++ debugToken2 ++ " found in " ++ res.err.toString ) res.err.split("\n").filter(_.startsWith(lib.red("Deleting"))).foreach{ line => assert( -- cgit v1.2.3