From bc4cf44291e00508c0c04d6d7adc6d03fdbaf1a1 Mon Sep 17 00:00:00 2001 From: mjago Date: Sat, 29 Oct 2016 13:11:27 +0100 Subject: [PATCH] Update integrations.yml to reflect rubySpec update - Adds support for regexp_bol_escape which was uncovered by rubyspec changes - Updates integrations.yml to expect a new error that wasn't encountered before - Fixes #687 --- lib/mutant/ast/regexp/transformer/direct.rb | 1 + lib/mutant/ast/types.rb | 1 + spec/integrations.yml | 21 ++------------------- spec/unit/mutant/ast/regexp_spec.rb | 5 +++++ 4 files changed, 9 insertions(+), 19 deletions(-) diff --git a/lib/mutant/ast/regexp/transformer/direct.rb b/lib/mutant/ast/regexp/transformer/direct.rb index b027cd53..0308386b 100644 --- a/lib/mutant/ast/regexp/transformer/direct.rb +++ b/lib/mutant/ast/regexp/transformer/direct.rb @@ -50,6 +50,7 @@ module Mutant [:regexp_set_open_escape, [:escape, :set_open, '\['], ::Regexp::Expression::EscapeSequence::Literal], [:regexp_set_close_escape, [:escape, :set_close, '\]'], ::Regexp::Expression::EscapeSequence::Literal], [:regexp_eol_escape, [:escape, :eol, '\$'], ::Regexp::Expression::EscapeSequence::Literal], + [:regexp_bol_escape, [:escape, :bol, '\^'], ::Regexp::Expression::EscapeSequence::Literal], [:regexp_bell_escape, [:escape, :bell, '\a'], ::Regexp::Expression::EscapeSequence::Literal], [:regexp_escape_escape, [:escape, :escape, '\e'], ::Regexp::Expression::EscapeSequence::AsciiEscape], [:regexp_form_feed_escape, [:escape, :form_feed, '\f'], ::Regexp::Expression::EscapeSequence::FormFeed], diff --git a/lib/mutant/ast/types.rb b/lib/mutant/ast/types.rb index ebc149cf..d72c5f83 100644 --- a/lib/mutant/ast/types.rb +++ b/lib/mutant/ast/types.rb @@ -50,6 +50,7 @@ module Mutant regexp_backslash_escape regexp_bell_escape regexp_bol_anchor + regexp_bol_escape regexp_bos_anchor regexp_capture_group regexp_carriage_escape diff --git a/spec/integrations.yml b/spec/integrations.yml index 809e22bb..a1525bd8 100644 --- a/spec/integrations.yml +++ b/spec/integrations.yml @@ -7,29 +7,12 @@ expected_errors: "#": - language/regexp/escapes_spec.rb - "#": - - core/string/shared/each_codepoint_without_block.rb - - core/string/shared/encode.rb - - core/string/shared/eql.rb - - core/string/shared/succ.rb - - core/string/slice_spec.rb - - core/string/squeeze_spec.rb - - core/string/unicode_normalize_spec.rb - - core/string/valid_encoding_spec.rb - - core/symbol/casecmp_spec.rb - - core/time/_dump_spec.rb - - core/time/_load_spec.rb - - language/regexp/encoding_spec.rb - - language/string_spec.rb - - library/openssl/shared/constants.rb - - library/socket/socket/gethostbyname_spec.rb - - library/zlib/inflate/set_dictionary_spec.rb - - optional/capi/encoding_spec.rb - - optional/capi/string_spec.rb '#': - language/regexp/escapes_spec.rb "#": - language/regexp/interpolation_spec.rb + '#': + - language/regexp/escapes_spec.rb - name: regexp_parser namespace: Regexp repo_uri: 'https://github.com/ammar/regexp_parser.git' diff --git a/spec/unit/mutant/ast/regexp_spec.rb b/spec/unit/mutant/ast/regexp_spec.rb index eb987953..42c0a7e0 100644 --- a/spec/unit/mutant/ast/regexp_spec.rb +++ b/spec/unit/mutant/ast/regexp_spec.rb @@ -113,6 +113,11 @@ RegexpSpec.expect_mapping(/^/, :regexp_bol_anchor) do s(:regexp_bol_anchor)) end +RegexpSpec.expect_mapping(/\^/, :regexp_bol_escape) do + s(:regexp_root_expression, + s(:regexp_bol_escape)) +end + RegexpSpec.expect_mapping(/\A/, :regexp_bos_anchor) do s(:regexp_root_expression, s(:regexp_bos_anchor))