From 82d040020750bcad98173b329d9e5395ae1e0dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Mangano-Tarumi?= Date: Mon, 29 Oct 2018 18:26:21 -0400 Subject: [PATCH] t: complex --set-all --- t/tags.t | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/t/tags.t b/t/tags.t index ab892f1..836ed19 100644 --- a/t/tags.t +++ b/t/tags.t @@ -7,6 +7,7 @@ use utf8; use Test::More tests => 18; use Digest::MD5; +use IPC::Open3; sub md5 { my ($file) = @_; @@ -74,8 +75,27 @@ is(`./opustags t/out.opus --delete-all -a OK=yes`, <<'EOF', 'delete all'); OK=yes EOF -is(`echo OK='yes again' | ./opustags t/out.opus --set-all`, <<'EOF', 'set all'); +my ($pin, $pout, $perr); +my $pid = open3($pin, $pout, $perr, './opustags t/out.opus --set-all -a A=B -s X=Z -d OK'); +binmode($pin, ':utf8'); +print $pin <<'EOF'; OK=yes again +ARTIST=七面鳥 +A=A +X=Y +EOF +close($pin); + +binmode($pout, ':utf8'); +is(<$pout>, <<'EOF', 'set all'); +OK=yes again +ARTIST=七面鳥 +A=A +X=Y +A=B +X=Z EOF +waitpid($pid, 0); + unlink('t/out.opus');