diff options
Diffstat (limited to 'examples/tools/test-video.sh')
| -rwxr-xr-x | examples/tools/test-video.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/tools/test-video.sh b/examples/tools/test-video.sh index 55a16d3..cca1aeb 100755 --- a/examples/tools/test-video.sh +++ b/examples/tools/test-video.sh @@ -73,6 +73,16 @@ check "own tmp removed" "$(command ls -d "$XDG_RUNTIME_DIR"/video-* | wc -l)" 1 out=$(v "$tmp/Hello Clip.mp4") contains "collision" "$(head -1 <<<"$out")" "$ASSISTANT_DIR/hello-clip-2.md " +# Words whisper repeats collapse; a stand-in whisper writes them. +mkdir -p "$tmp/wbin" +printf '%s\n' '#!/bin/bash' 'while [ $# -gt 0 ]; do [ "$1" = -of ] && of=$2; shift; done' \ + "printf ' Revis Revis Revis Good morning.\\n three themes themes, running\\n running through it.\\n' > \"\$of.txt\"" \ + > "$tmp/wbin/whisper-cli" +chmod +x "$tmp/wbin/whisper-cli" +PATH=$tmp/wbin:$PATH v "$tmp/Hello Clip.mp4" >/dev/null +contains "dedupe" "$(cat "$ASSISTANT_DIR/hello-clip-3.md" 2>/dev/null)" \ + "Revis Good morning. three themes, running through it." + # Refusals: one error line, exit 1, nothing written. before=$(command ls "$ASSISTANT_DIR" | wc -l) out=$(v "$tmp/silent.mkv"); check "no audio rc" $? 1 @@ -116,6 +126,7 @@ check "subs no note" "$(grep -c 'comment\|spans' <<<"$md")" 0 sed 's/$/\r/' "$tmp/it.vtt" > "$tmp/crlf.vtt" out=$(STUB_META=$'125\tFalse\tNA\tCRLF' STUB_VTT="$tmp/crlf.vtt" v "https://example.org/v/9") md=$(cat "$ASSISTANT_DIR/crlf.md" 2>/dev/null) +contains "short full" "$out" $'\nfull text:\n' contains "crlf text" "$md" 'Ciao a tutti & benvenuti Oggi parliamo di Slackware.' check "crlf no cue ids" "$(grep -c '^[0-9] \| 2 ' <<<"$md")" 0 @@ -143,6 +154,7 @@ contains "no length, long" "$out" "long: Long reel, 31:00." { printf 'WEBVTT\n\n'; for i in $(seq 400); do printf '00:00:%02d.000 --> 00:00:%02d.500\nline number %d of the talk.\n\n' $((i % 60)) $((i % 60)) "$i"; done; } > "$tmp/big.vtt" out=$(STUB_META=$'600\tFalse\ten\tBig Talk' STUB_VTT="$tmp/big.vtt" v "https://example.org/v/6") contains "big path" "$(head -1 <<<"$out")" "big-talk.md (2400 words" +contains "big start only" "$out" "start, not the whole text" check "big under cap" "$(( ${#out} < 2000 ))" 1 para=$(awk 'NR > 5 && NF' "$ASSISTANT_DIR/big-talk.md" | head -1) check "paragraph joined to a sentence end" "$(( ${#para} > 400 && ${#para} < 440 ))" 1 |
