use strict; use utf8; use Test::Base; use String::Diff qw( diff ); filters { data1 => 'yaml', data2 => [qw/ yaml string_diff /] }; sub string_diff { my $input = shift; my $diff = diff($input->{old}, $input->{new}, %{ $input->{options} }); $diff; } run_compare; __END__ === --- data1 - perl - pe{a}rl --- data2 old: perl new: pearl === --- data1 - 'th[i]s [is ]a[ pen]' - "th{at'}s a{ll}" --- data2 old: this is a pen new: that's all === --- data1 - '[S]oo[z]y' - '{B}oo{f}y' --- data2 old: Soozy new: Boofy === --- data1 - '[あ]る[晴れた日に散歩をすると]、そ[こに]は' - '{いつもい}る{人がいないので}、そ{れ}は' --- data2 old: ある晴れた日に散歩をすると、そこには new: いつもいる人がいないので、それは === --- data1 - |- This library is [free software]; you can redistribute it and[/or] modify it under the same terms as Perl itself. - |- This library is {自由なソフト}; you can {not }redistribute it {or/}and modify it under the same terms as Pe{a}rl it{ }self. --- data2 old: |- This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. new: |- This library is 自由なソフト; you can not redistribute it or/and modify it under the same terms as Pearl it self. === --- data1 - |- This library is [free software]; you can redistribute it and[/or] modify[ ]it under the same terms as Perl itself. - This library is {自由なソフト}; you can {not }redistribute it {or/}and modify{ }it under the same terms as Pe{a}rl it{ }self. --- data2 old: |- This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. new: This library is 自由なソフト; you can not redistribute it or/and modify it under the same terms as Pearl it self. === --- data1 - |- [remove ]This library is [free software]; you can redistribute it and[/or] modify (snip) it under the same terms as Perl itself. - |- This library is {自由なソフト}; you can {not }redistribute it {or/}and modify (snip) it under the same terms as Pe{a}rl it{ }self.{ append} --- data2 old: |- remove This library is free software; you can redistribute it and/or modify (snip) it under the same terms as Perl itself. new: |- This library is 自由なソフト; you can not redistribute it or/and modify (snip) it under the same terms as Pearl it self. append === --- data1 - |- This library is [free software]; you can redistribute it and[/or] modify it under the same terms as Perl itself. - |- This library is {自由なソフト}; you can {not }redistribute it {or/}and modify it under the same terms as Pe{a}rl it{ }self. --- data2 old: |- This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. new: |- This library is 自由なソフト; you can not redistribute it or/and modify it under the same terms as Pearl it self. options: linebreak: 1 === --- data1 - |- remo[ve] [This library is free software; you can redistribute it and/or modify][ ](snip) it under the same terms as Perl itself. - |- {This lib}r{ary is 自由なソフト; you can not r}e{distribute it or/and }mo{dify} (snip) it under the same terms as Pe{a}rl it{ }self.{ }{append} --- data2 old: |- remove This library is free software; you can redistribute it and/or modify (snip) it under the same terms as Perl itself. new: |- This library is 自由なソフト; you can not redistribute it or/and modify (snip) it under the same terms as Pearl it self. append options: linebreak: 1 === --- data1 - |- This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. - |- This library is 自由なソフト; you can not redistribute it or/and modify it under the same terms as Pearl it self. --- data2 old: |- This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. new: |- This library is 自由なソフト; you can not redistribute it or/and modify it under the same terms as Pearl it self. options: linebreak: 1 remove_open: remove_close: append_open: append_close: === --- data1 - 1[0] - 1{1} --- data2 old: 10 new: 11