You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all, just a small problem in the matcher with crystal 0.33...
Given this file test_problem.cr
require "spectator"
Spectator.describe "A test" do
it "should work" do
expect(7).to be_between(1, 10)
end
end
I get this:
crystal spec ./test_problem.cr
There was a problem expanding macro 'be_between'
Code in test_problem.cr:4:18
4 | expect(7).to be_between(1, 10)
^
Called macro defined in lib/spectator/src/spectator/dsl/matchers.cr:344:5
344 | macro be_between(min, max)
Which expanded to:
> 1 | __temp_1031 = Range.new(1, 10))
^
Error: unexpected token: )
Running with --error-trace gives this trace:
In test_problem.cr:3:3
3 | it "should work" do
^
Error: expanding macro
There was a problem expanding macro 'it'
Called macro defined in lib/spectator/src/spectator/dsl/examples.cr:6:5
6 | macro it(description = nil, _source_file = __FILE__, _source_line = __LINE__, &block)
Which expanded to:
> 1 |
> 2 | def __temp_35
> 3 | (expect(7)).to(be_between(1, 10))
> 4 | end
> 5 |
> 6 |
> 7 | __temp_36 = ::Spectator::Source.new("/Users/tuad/work/slack/voronoi_stuff/crystal_voro/voronoi_geometry/test_problem.cr", 3)
> 8 | ::Spectator::SpecBuilder.add_example(
> 9 | "should work",
> 10 | __temp_36,
> 11 | SpectatorTest::Context__temp_33
> 12 | ) { |test| test.as(SpectatorTest::Context__temp_33).__temp_35 }
> 13 |
Error: instantiating 'SpectatorTest::Context__temp_33#__temp_35()'
There was a problem expanding macro 'be_between'
Called macro defined in lib/spectator/src/spectator/dsl/matchers.cr:344:5
344 | macro be_between(min, max)
Which expanded to:
> 1 | __temp_1031 = Range.new(1, 10))
> 2 | __temp_1032 = ["1", "10"].join(" to ")
> 3 | __temp_1033 = ::Spectator::TestValue.new(__temp_1031, __temp_1032)
> 4 | :Spectator::Matchers::RangeMatcher.new(__temp_1033)
> 5 |
Error: unexpected token: )
The text was updated successfully, but these errors were encountered:
Thank you for the detailed information! Looks like there is a hard to spot extra paren in there. I'll take a look at your MR and we can get this fixed 😄
Hi all, just a small problem in the matcher with crystal 0.33...
Given this file test_problem.cr
I get this:
Running with --error-trace gives this trace:
The text was updated successfully, but these errors were encountered: