Skip to content

Commit

Permalink
Rename debug to inspect
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Jul 1, 2024
1 parent 5baf9a2 commit fef2107
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/core/guillotine.Executable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ object Pipeline:
given Pipeline is Communicable =
pipeline => m"${pipeline.commands.map(_.show).join(t" | ")}"

given Debug[Pipeline] = _.commands.map(_.debug).join(t" | ")
given Debug[Pipeline] = _.commands.map(_.inspect).join(t" | ")
given Pipeline is Showable = _.commands.map(_.show).join(t" | ")

case class Pipeline(commands: Command*) extends Executable:
Expand Down
12 changes: 6 additions & 6 deletions src/test/tests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -141,24 +141,24 @@ object Tests extends Suite(t"Guillotine tests"):

suite(t"rendering Debug")
test(t"simple command"):
sh"echo Hello World".debug
sh"echo Hello World".inspect
.check(_ == t"""sh"echo Hello World"""")

println(sh"echo 'Hello World'".debug)
println(sh"echo 'Hello World'".inspect)
test(t"simple command with space"):
sh"echo 'Hello World'".debug
sh"echo 'Hello World'".inspect
.check(_ == t"""sh"echo 'Hello World'"""")

test(t"simple command with quote and space"):
Command(t"echo", t"Don't stop").debug
Command(t"echo", t"Don't stop").inspect
.check(_ == t"sh\"\"\"echo \"Don't stop\"\"\"\"")

test(t"simple command with single and double quote"):
Command(t"echo", t"single ' and double \" quotes").debug
Command(t"echo", t"single ' and double \" quotes").inspect
.check(_ == t"sh\"\"\"echo \"single ' and double \\\" quotes\"\"\"\"")

test(t"render pipeline of commands"):
(sh"echo Hello" | sh"sed s/e/a/g").debug
(sh"echo Hello" | sh"sed s/e/a/g").inspect
.check(_ == t"""sh"echo Hello" | sh"sed s/e/a/g"""")

suite(t"equality tests"):
Expand Down

0 comments on commit fef2107

Please sign in to comment.