From 954d0fb042a9c9d27f64283410ed7509aabdddfe Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 27 Nov 2021 11:01:12 -0800 Subject: [PATCH] Output more information in read --nchars test To try to track down a test failure, improve the error message. --- tests/checks/read.fish | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/checks/read.fish b/tests/checks/read.fish index 9a80402b4..8801b6246 100644 --- a/tests/checks/read.fish +++ b/tests/checks/read.fish @@ -244,7 +244,9 @@ if test $status -ne 0 echo the read of the max amount of data failed unexpectedly end if test (string length "$x") -ne $fish_read_limit - echo reading the max amount of data with --nchars failed the length test: (string length "$x") / $fish_read_limit + # See how much data 'yes' produced. + set yeslen (yes $line | dd bs=1024 count=(math "$fish_read_limit / 1024") 2>/dev/null | wc -c | tr -d " \t\n\r") + echo reading the max amount of data with --nchars failed the length test. read: (string length "$x"), limit: $fish_read_limit, yes produced: $yeslen end # Confirm reading non-interactively works -- \#4206 regression