1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-11-13 11:04:27 -05:00
libkernaux/pkgs/mruby/test/printf.rb

39 lines
924 B
Ruby
Raw Normal View History

2022-05-24 10:31:21 -04:00
# TODO: implement this
# rubocop:disable Style/BlockComments
=begin
assert 'KernAux.sprintf' do
[
['', 'using regular tests'],
['_orig', 'using original tests'],
].each do |(suffix, description)|
assert description do
printf_yml =
2022-05-27 20:07:14 -04:00
File.expand_path("../../../../common/printf#{suffix}.yml", __FILE__)
2022-05-24 10:31:21 -04:00
YAML.load(File.read(printf_yml)).each do |test|
expected = test['result']
args = test['args'].map do |arg|
if arg.is_a? String
arg
else
arg.map do |item|
if item.is_a? Array
item[0]
else
item
end
end
end
end
2022-05-24 10:31:21 -04:00
assert "transforms #{args.inspect} to #{expected.inspect}" do
assert_equal expected, KernAux.sprintf(*args)
end
end
end
end
end
=end
# rubocop:enable Style/BlockComments