xmp2assert 13 → 14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca1ec4816655792e3a7191b25a2215bd26ba9f0b
4
- data.tar.gz: 1df637b6cdafa53ca5ee6719516f0e5f5d6e82d7
3
+ metadata.gz: 65892e6017608a18fa23ea592867ced1341486d5
4
+ data.tar.gz: 4406ecb00f9f72056c30cd60820fc0c0cfd629d8
5
5
  SHA512:
6
- metadata.gz: 667fbe7d5bed82ce1bc54c4dd353b97d0aeaff04fa2ac112427c1123964d125b234b8100f4bd271aaa0cc5675d4de31f7c8e87facaf9faab7512388bf773d005
7
- data.tar.gz: e0fecfd10bedc2fdfdbe3e7e428a0a9f697790238548450439ebb71e86a2c1f44e6467f5ed06cd229d642e176ca14bce91f97dea8693d2030ed0de638671ec25
6
+ metadata.gz: a82ceac5e13819b380baa4a9039c8b466303e089002ab803cfe9c15f7f49f30772e510fb0e9f00db9fd9ecc8f3955a829664c9f0696315f02cb2dc61c5f2eb26
7
+ data.tar.gz: 5819e605413a3cbd8fb88abc6731ea8c70460d4f87b14a16297c60bfda1aec3effbae22e6bfac47a53011498a6261a719b2c41fc7484a3ba06237a13a8e1e98e
@@ -83,11 +83,12 @@ class XMP2Assert::Converter
83
83
  private_constant :Namespace
84
84
 
85
85
  def gen_tap tok
86
- xmp = tok.to_s.chomp.dump
87
86
  case tok.to_sym
88
87
  when :'~>' then
88
+ xmp = "#<#{tok.to_s.chomp}>".dump
89
89
  return sprintf " rescue (xmp2assert_assert(%s, $!) and raise)", xmp
90
90
  when :'=>' then
91
+ xmp = tok.to_s.chomp.dump
91
92
  nam = gensym xmp
92
93
  return sprintf ".tap {|%s| xmp2assert_assert(%s, %s) }", nam, xmp, nam
93
94
  end
@@ -368,7 +369,7 @@ class XMP2Assert::Converter
368
369
  buf[sym] = tok.to_s << buf[sym]
369
370
  tok.yylex = :comment
370
371
  tok.yylval = "#\n"
371
- when :sp, :nl then
372
+ when :sp, :nl, :comment then
372
373
  next
373
374
  else
374
375
  break
@@ -59,8 +59,9 @@ rescue Exception => e
59
59
  b = e.backtrace
60
60
  b.reject! {|i| i.start_with? __FILE__ }
61
61
  e.set_backtrace b
62
- expected = <%= exception.dump %> #=
63
- xmp2assert_assert expected, e, e.backtrace
62
+ expected = <%= exception.dump %>.lines #=
63
+ xmp2assert_assert expected[0], e.class, e.backtrace
64
+ xmp2assert_assert expected[1].chomp.inspect, e.message, e.backtrace
64
65
  end
65
66
  % else
66
67
  eval src, saved_binding, file, line
@@ -24,4 +24,4 @@
24
24
  # SOFTWARE.
25
25
  ;
26
26
 
27
- XMP2Assert::VERSION = 13
27
+ XMP2Assert::VERSION = 14
@@ -62,6 +62,7 @@ class XMP2Assert::XMP2Rexp
62
62
  next sprintf '\\u(?:%s|\\{%s\\})', str, hex.downcase
63
63
  }
64
64
  src.gsub!(/\\\.rb:\d+/, '\\.rb:\d+')
65
+ src.gsub!(/(\\\.){3}/, '.+?')
65
66
 
66
67
  case nln when 0, 1 then
67
68
  return Regexp.new "\\A#{src}\\n?\\z"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xmp2assert
3
3
  version: !ruby/object:Gem::Version
4
- version: '13'
4
+ version: '14'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Urabe, Shyouhei
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-23 00:00:00.000000000 Z
11
+ date: 2017-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler