Skip to content

Instantly share code, notes, and snippets.

@Whateverable
Created January 15, 2020 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Whateverable/70baea0a88486f01573a3bb5c60ecacd to your computer and use it in GitHub Desktop.
Save Whateverable/70baea0a88486f01573a3bb5c60ecacd to your computer and use it in GitHub Desktop.
committable6
e76f8e4d3e^,e76f8e4d3e https://gist.github.com/AlexDaniel/2119ef7a81750ad4be02476bbc011f30
¦«e76f8e4d3e^»:
1..7
not ok 1 - evaling a construction gists out exactly the same again.
# Failed test 'evaling a construction gists out exactly the same again.'
# at ./sandbox/01-tree.p6 line 15
# expected: 'Tree.new-branch(left => Tree.new-branch(left => Tree.new-leaf(storage => 1), right => Tree.new-leaf(storage => 2)), right => Tree.new-leaf(storage => 3))'
# got: 'Tree.new-branch(left => Tree.new(branch => Branch.new(left => Tree.new(branch => Any, leaf => Leaf.new(storage => 1)), right => Tree.new(branch => Any, leaf => Leaf.new(storage => 2))), leaf => Any), right => Tree.new(branch => Any, leaf => Leaf.new(storage => 3)))'
not ok 2 - evaling a construction perls out exactly the same again.
# Failed test 'evaling a construction perls out exactly the same again.'
# at ./sandbox/01-tree.p6 line 16
# expected: 'Tree.new-branch(left => Tree.new-branch(left => Tree.new-leaf(storage => 1), right => Tree.new-leaf(storage => 2)), right => Tree.new-leaf(storage => 3))'
# got: 'Tree.new-branch(left => Tree.new(branch => Branch.new(left => Tree.new(branch => Any, leaf => Leaf.new(storage => 1)), right => Tree.new(branch => Any, leaf => Leaf.new(storage => 2))), leaf => Any), right => Tree.new(branch => Any, leaf => Leaf.new(storage => 3)))'
not ok 3 - positional args for constructors work, too
# Failed test 'positional args for constructors work, too'
# at ./sandbox/01-tree.p6 line 24
# expected: 'Tree.new-branch(left => Tree.new-branch(left => Tree.new-leaf(storage => 1), right => Tree.new-leaf(storage => 2)), right => Tree.new-leaf(storage => 3))'
# got: 'Tree.new-branch(left => Tree.new(branch => Branch.new(left => Tree.new(branch => Any, leaf => Leaf.new(storage => 1)), right => Tree.new(branch => Any, leaf => Leaf.new(storage => 2))), leaf => Any), right => Tree.new(branch => Any, leaf => Leaf.new(storage => 3)))'
ok 4 - example treemaps work
ok 5 - smartmatch against container class
ok 6 - smartmatch against one constructor
ok 7 - smartmatch against another constructor
# You failed 3 tests of 7
«exit code = 3»
¦«e76f8e4»:
1..7
not ok 1 - evaling a construction gists out exactly the same again.
# Failed test 'evaling a construction gists out exactly the same again.'
# at ./sandbox/01-tree.p6 line 15
# expected: 'Tree.new-branch(left => Tree.new-branch(left => Tree.new-leaf(storage => 1), right => Tree.new-leaf(storage => 2)), right => Tree.new-leaf(storage => 3))'
# got: (Nil)
not ok 2 - evaling a construction perls out exactly the same again.
# Failed test 'evaling a construction perls out exactly the same again.'
# at ./sandbox/01-tree.p6 line 16
# expected: 'Tree.new-branch(left => Tree.new-branch(left => Tree.new-leaf(storage => 1), right => Tree.new-leaf(storage => 2)), right => Tree.new-leaf(storage => 3))'
# got: (Nil)
not ok 3 - positional args for constructors work, too
# Failed test 'positional args for constructors work, too'
# at ./sandbox/01-tree.p6 line 24
# expected: 'Tree.new-branch(left => Tree.new-branch(left => Tree.new-leaf(storage => 1), right => Tree.new-leaf(storage => 2)), right => Tree.new-leaf(storage => 3))'
# got: (Nil)
not ok 4 - example treemaps work
# Failed test 'example treemaps work'
# at ./sandbox/01-tree.p6 line 37
# expected: '60'
# got: (Any)
ok 5 - smartmatch against container class
not ok 6 - smartmatch against one constructor
# Failed test 'smartmatch against one constructor'
# at ./sandbox/01-tree.p6 line 40
No such method 'right' for invocant of type 'Any'
in block <unit> at ./sandbox/01-tree.p6 line 41
# You planned 7 tests, but ran 6
# You failed 5 tests of 6
«exit code = 5»
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment