rspec_junit_formatter_bitbucket 0.2.0.pre.182 → 0.2.0.pre.183
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b32f751c5d566b1ba7d753793467d9f973afd22f9dc33867640010b547bcdbb
|
4
|
+
data.tar.gz: f888a34263fd84f891cbea4cf0d9be6273a0cb593c818c0b4b20c65a3196102f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9910fa487fda1bf91af4fe73c6ff06040afdcd493a7770bfd28896bba856c11730af9b81eeab773fc5eca523b83681732458e351a378db372db398cf599f7e1f
|
7
|
+
data.tar.gz: 77dcfb2d7127394b74e445d6a74a438d8d440d99235db5206fb2043c46f8fdae9debfb44a020db5acf249ec0b1af9e697c023e494ba7b6ec50e17be06a3a2921
|
@@ -7,6 +7,7 @@ module RspecJunitFormatterBitbucket
|
|
7
7
|
module Format
|
8
8
|
# Inversion of character range from https://www.w3.org/TR/xml/#charsets
|
9
9
|
ILLEGAL_REGEXP = Regexp.new(
|
10
|
+
=begin
|
10
11
|
'\[\^' \
|
11
12
|
'\u{9}' \
|
12
13
|
'\u{a}' \
|
@@ -15,10 +16,20 @@ module RspecJunitFormatterBitbucket
|
|
15
16
|
'\u{e000}-\u{fffd}' \
|
16
17
|
'\u{10000}-\u{10ffff}' \
|
17
18
|
'\]'
|
19
|
+
=end
|
20
|
+
"[^" <<
|
21
|
+
"\u{9}" << # => \t
|
22
|
+
"\u{a}" << # => \n
|
23
|
+
"\u{d}" << # => \r
|
24
|
+
"\u{20}-\u{d7ff}" <<
|
25
|
+
"\u{e000}-\u{fffd}" <<
|
26
|
+
"\u{10000}-\u{10ffff}" <<
|
27
|
+
"]"
|
18
28
|
)
|
19
29
|
|
20
30
|
# Replace illegals with a Ruby-like escape
|
21
31
|
ILLEGAL_REPLACEMENT = Hash.new do |_, c|
|
32
|
+
=begin
|
22
33
|
x = c.ord
|
23
34
|
if x <= 0xff
|
24
35
|
'\\x%02X'.freeze % x
|
@@ -27,18 +38,36 @@ module RspecJunitFormatterBitbucket
|
|
27
38
|
else
|
28
39
|
'\\u{%<X>}'.freeze % x
|
29
40
|
end.freeze
|
41
|
+
=end
|
42
|
+
x = c.ord
|
43
|
+
if x <= 0xff
|
44
|
+
"\\x%02X".freeze % x
|
45
|
+
elsif x <= 0xffff
|
46
|
+
"\\u%04X".freeze % x
|
47
|
+
else
|
48
|
+
"\\u{%X}".freeze % x
|
49
|
+
end.freeze
|
30
50
|
end.update(
|
51
|
+
=begin
|
31
52
|
"\0".freeze => '\\0'.freeze,
|
32
53
|
"\a".freeze => '\\a'.freeze,
|
33
54
|
"\b".freeze => '\\b'.freeze,
|
34
55
|
"\f".freeze => '\\f'.freeze,
|
35
56
|
"\v".freeze => '\\v'.freeze,
|
36
57
|
"\e".freeze => '\\e'.freeze
|
58
|
+
=end
|
59
|
+
"\0".freeze => "\\0".freeze,
|
60
|
+
"\a".freeze => "\\a".freeze,
|
61
|
+
"\b".freeze => "\\b".freeze,
|
62
|
+
"\f".freeze => "\\f".freeze,
|
63
|
+
"\v".freeze => "\\v".freeze,
|
64
|
+
"\e".freeze => "\\e".freeze,
|
37
65
|
).freeze
|
38
66
|
|
39
67
|
# Discouraged characters from https://www.w3.org/TR/xml/#charsets
|
40
68
|
# Plus special characters with well-known entity replacements
|
41
69
|
DISCOURAGED_REGEXP = Regexp.new(
|
70
|
+
=begin
|
42
71
|
'[' \
|
43
72
|
'\u{22}' \
|
44
73
|
'\u{26}' \
|
@@ -65,24 +94,59 @@ module RspecJunitFormatterBitbucket
|
|
65
94
|
'\u{ffffe}-\u{fffff}' \
|
66
95
|
'\u{10fffe}-\u{10ffff}' \
|
67
96
|
']'
|
97
|
+
=end
|
98
|
+
"[" <<
|
99
|
+
"\u{22}" << # => "
|
100
|
+
"\u{26}" << # => &
|
101
|
+
"\u{27}" << # => '
|
102
|
+
"\u{3c}" << # => <
|
103
|
+
"\u{3e}" << # => >
|
104
|
+
"\u{7f}-\u{84}" <<
|
105
|
+
"\u{86}-\u{9f}" <<
|
106
|
+
"\u{fdd0}-\u{fdef}" <<
|
107
|
+
"\u{1fffe}-\u{1ffff}" <<
|
108
|
+
"\u{2fffe}-\u{2ffff}" <<
|
109
|
+
"\u{3fffe}-\u{3ffff}" <<
|
110
|
+
"\u{4fffe}-\u{4ffff}" <<
|
111
|
+
"\u{5fffe}-\u{5ffff}" <<
|
112
|
+
"\u{6fffe}-\u{6ffff}" <<
|
113
|
+
"\u{7fffe}-\u{7ffff}" <<
|
114
|
+
"\u{8fffe}-\u{8ffff}" <<
|
115
|
+
"\u{9fffe}-\u{9ffff}" <<
|
116
|
+
"\u{afffe}-\u{affff}" <<
|
117
|
+
"\u{bfffe}-\u{bffff}" <<
|
118
|
+
"\u{cfffe}-\u{cffff}" <<
|
119
|
+
"\u{dfffe}-\u{dffff}" <<
|
120
|
+
"\u{efffe}-\u{effff}" <<
|
121
|
+
"\u{ffffe}-\u{fffff}" <<
|
122
|
+
"\u{10fffe}-\u{10ffff}" <<
|
123
|
+
"]"
|
68
124
|
)
|
69
125
|
|
70
126
|
# Translate well-known entities, or use generic unicode hex entity
|
71
127
|
DISCOURAGED_REPLACEMENTS = Hash.new do |_, c|
|
72
128
|
"&#x#{c.ord.to_s(16)};".freeze
|
129
|
+
# "&#x#{c.ord.to_s(16)};".freeze
|
73
130
|
end.update(
|
131
|
+
=begin
|
74
132
|
'"'.freeze => '"'.freeze,
|
75
133
|
'&'.freeze => '&'.freeze,
|
76
134
|
"'".freeze => '''.freeze,
|
77
135
|
'<'.freeze => '<'.freeze,
|
78
136
|
'>'.freeze => '>'.freeze
|
137
|
+
=end
|
138
|
+
?".freeze => """.freeze,
|
139
|
+
?&.freeze => "&".freeze,
|
140
|
+
?'.freeze => "'".freeze,
|
141
|
+
?<.freeze => "<".freeze,
|
142
|
+
?>.freeze => ">".freeze,
|
79
143
|
).freeze
|
80
144
|
|
81
145
|
def self.escape(text)
|
82
146
|
text.to_s
|
83
147
|
.encode(Encoding::UTF_8)
|
84
|
-
.gsub(ILLEGAL_REGEXP, ILLEGAL_REPLACEMENT)
|
85
|
-
.gsub(DISCOURAGED_REGEXP, DISCOURAGED_REPLACEMENTS)
|
148
|
+
# .gsub(ILLEGAL_REGEXP, ILLEGAL_REPLACEMENT)
|
149
|
+
# .gsub(DISCOURAGED_REGEXP, DISCOURAGED_REPLACEMENTS)
|
86
150
|
end
|
87
151
|
|
88
152
|
# rubocop:disable Metrics/LineLength
|
@@ -66,7 +66,7 @@ module RspecJunitFormatterBitbucket
|
|
66
66
|
|
67
67
|
def dump_failed(example)
|
68
68
|
dump_example(example) do
|
69
|
-
@output << %(
|
69
|
+
@output << %(<failure #{rm_char_nw_line(failure_attr(example))}>)
|
70
70
|
@output << Format.escape(@test.failure_for(example))
|
71
71
|
@output << %(</failure>)
|
72
72
|
end
|