diff options
| author | Matthew Hall <hallmatthew314@gmail.com> | 2023-03-09 00:57:22 +1300 |
|---|---|---|
| committer | Matthew Hall <hallmatthew314@gmail.com> | 2023-03-09 00:57:22 +1300 |
| commit | 8f8bee2893df280bd013e06c338838c758c4d8fc (patch) | |
| tree | 0009c95560929f289881804f59e6ca85d2d335a2 /spec/parcom_spec.cr | |
| parent | ce254c83be3cf613a8f655f55f2207073404148f (diff) | |
Rewrite Map to use blocks
Diffstat (limited to 'spec/parcom_spec.cr')
| -rw-r--r-- | spec/parcom_spec.cr | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/spec/parcom_spec.cr b/spec/parcom_spec.cr index 346e61b..bdf8b5b 100644 --- a/spec/parcom_spec.cr +++ b/spec/parcom_spec.cr @@ -163,7 +163,6 @@ end describe Assert do test_f = ->(x : Char) { x == 't' } - #p_proc = Assert.new(AnyToken(Char).new, test_f) p = AnyToken(Char).new.assert { |x| x == 't' } describe "#parse" do @@ -245,15 +244,13 @@ end describe Map do describe "#parse" do it "fails if the wrapped parser fails" do - id = ->(x : Char) { x } - p = Map.new(AnyToken(Char).new, id) + p = AnyToken(Char).new.map { |x| x } expect_raises(ParserException) { p.parse(TokenStream.new([] of Char)) } end it "changes the result value via the provided proc" do - is_letter = ->(x : Char) { x.letter? } - p = Map.new(AnyToken(Char).new, is_letter) + p = AnyToken(Char).new.map { |x| x.letter? } result = p.parse(TokenStream.from_string("testing")) result.value.should be_true |
