Skip to content

Commit 1066b39

Browse files
nagachikahsbt
authored andcommitted
merge revision(s) f367b4ffe739453e87e55f955138b0ce662942b7,31a757a4426f1ac8c479313e01542940386fc2fe,837cbea64b74d464bfbfb10e6c81a8f92c6eee71:
assert_equal accepts an expected value as the first argument --- test/psych/test_coder.rb | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) Make the test pass with the old libyaml I have no idea what result is right, but it fails with libyaml 0.1.7 (bundled with Ubuntu 18.04) anyway. --- test/psych/test_coder.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) test/psych/test_coder.rb: Suppress non-parenthesis warnings http://rubyci.s3.amazonaws.com/debian9/ruby-master/log/20210518T093002Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20210518T093002Z/ruby/test/psych/test_coder.rb:277: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator ``` --- test/psych/test_coder.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
1 parent f243797 commit 1066b39

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

test/psych/test_coder.rb

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -216,113 +216,113 @@ def test_dump_init_with
216216

217217
def test_coder_style_map_default
218218
foo = Psych.dump a: 1, b: 2
219-
assert_equal foo, "---\n:a: 1\n:b: 2\n"
219+
assert_equal "---\n:a: 1\n:b: 2\n", foo
220220
end
221221

222222
def test_coder_style_map_any
223223
foo = Psych.dump CustomEncode.new \
224224
map: {a: 1, b: 2},
225225
style: Psych::Nodes::Mapping::ANY,
226226
tag: nil
227-
assert_equal foo, "---\n:a: 1\n:b: 2\n"
227+
assert_equal "---\n:a: 1\n:b: 2\n", foo
228228
end
229229

230230
def test_coder_style_map_block
231231
foo = Psych.dump CustomEncode.new \
232232
map: {a: 1, b: 2},
233233
style: Psych::Nodes::Mapping::BLOCK,
234234
tag: nil
235-
assert_equal foo, "---\n:a: 1\n:b: 2\n"
235+
assert_equal "---\n:a: 1\n:b: 2\n", foo
236236
end
237237

238238
def test_coder_style_map_flow
239239
foo = Psych.dump CustomEncode.new \
240240
map: { a: 1, b: 2 },
241241
style: Psych::Nodes::Mapping::FLOW,
242242
tag: nil
243-
assert_equal foo, "--- {! ':a': 1, ! ':b': 2}\n"
243+
assert_equal "--- {! ':a': 1, ! ':b': 2}\n", foo
244244
end
245245

246246
def test_coder_style_seq_default
247247
foo = Psych.dump [ 1, 2, 3 ]
248-
assert_equal foo, "---\n- 1\n- 2\n- 3\n"
248+
assert_equal "---\n- 1\n- 2\n- 3\n", foo
249249
end
250250

251251
def test_coder_style_seq_any
252252
foo = Psych.dump CustomEncode.new \
253253
seq: [ 1, 2, 3 ],
254254
style: Psych::Nodes::Sequence::ANY,
255255
tag: nil
256-
assert_equal foo, "---\n- 1\n- 2\n- 3\n"
256+
assert_equal "---\n- 1\n- 2\n- 3\n", foo
257257
end
258258

259259
def test_coder_style_seq_block
260260
foo = Psych.dump CustomEncode.new \
261261
seq: [ 1, 2, 3 ],
262262
style: Psych::Nodes::Sequence::BLOCK,
263263
tag: nil
264-
assert_equal foo, "---\n- 1\n- 2\n- 3\n"
264+
assert_equal "---\n- 1\n- 2\n- 3\n", foo
265265
end
266266

267267
def test_coder_style_seq_flow
268268
foo = Psych.dump CustomEncode.new \
269269
seq: [ 1, 2, 3 ],
270270
style: Psych::Nodes::Sequence::FLOW,
271271
tag: nil
272-
assert_equal foo, "--- [1, 2, 3]\n"
272+
assert_equal "--- [1, 2, 3]\n", foo
273273
end
274274

275275
def test_coder_style_scalar_default
276276
foo = Psych.dump 'some scalar'
277-
assert_equal foo, "--- some scalar\n"
277+
assert_match(/\A--- some scalar\n(?:\.\.\.\n)?\z/, foo)
278278
end
279279

280280
def test_coder_style_scalar_any
281281
foo = Psych.dump CustomEncode.new \
282282
scalar: 'some scalar',
283283
style: Psych::Nodes::Scalar::ANY,
284284
tag: nil
285-
assert_equal foo, "--- some scalar\n"
285+
assert_match(/\A--- some scalar\n(?:\.\.\.\n)?\z/, foo)
286286
end
287287

288288
def test_coder_style_scalar_plain
289289
foo = Psych.dump CustomEncode.new \
290290
scalar: 'some scalar',
291291
style: Psych::Nodes::Scalar::PLAIN,
292292
tag: nil
293-
assert_equal foo, "--- some scalar\n"
293+
assert_match(/\A--- some scalar\n(?:\.\.\.\n)?\z/, foo)
294294
end
295295

296296
def test_coder_style_scalar_single_quoted
297297
foo = Psych.dump CustomEncode.new \
298298
scalar: 'some scalar',
299299
style: Psych::Nodes::Scalar::SINGLE_QUOTED,
300300
tag: nil
301-
assert_equal foo, "--- ! 'some scalar'\n"
301+
assert_equal "--- ! 'some scalar'\n", foo
302302
end
303303

304304
def test_coder_style_scalar_double_quoted
305305
foo = Psych.dump CustomEncode.new \
306306
scalar: 'some scalar',
307307
style: Psych::Nodes::Scalar::DOUBLE_QUOTED,
308308
tag: nil
309-
assert_equal foo, %Q'--- ! "some scalar"\n'
309+
assert_equal %Q'--- ! "some scalar"\n', foo
310310
end
311311

312312
def test_coder_style_scalar_literal
313313
foo = Psych.dump CustomEncode.new \
314314
scalar: 'some scalar',
315315
style: Psych::Nodes::Scalar::LITERAL,
316316
tag: nil
317-
assert_equal foo, "--- ! |-\n some scalar\n"
317+
assert_equal "--- ! |-\n some scalar\n", foo
318318
end
319319

320320
def test_coder_style_scalar_folded
321321
foo = Psych.dump CustomEncode.new \
322322
scalar: 'some scalar',
323323
style: Psych::Nodes::Scalar::FOLDED,
324324
tag: nil
325-
assert_equal foo, "--- ! >-\n some scalar\n"
325+
assert_equal "--- ! >-\n some scalar\n", foo
326326
end
327327
end
328328
end

0 commit comments

Comments
 (0)