diff --git a/tests/test-clipmenu b/tests/test-clipmenu index 3916c36..02dc711 100755 --- a/tests/test-clipmenu +++ b/tests/test-clipmenu @@ -6,9 +6,9 @@ set -o pipefail : "${CM_DIR="${XDG_RUNTIME_DIR-"${TMPDIR-/tmp}"}"}" -major_version=4 +major_version=5 dir=$CM_DIR/clipmenu.$major_version.$USER -cache_file=$dir/line_cache +cache_file=$dir/line_cache_primary if [[ $0 == /* ]]; then location=${0%/*} @@ -58,8 +58,8 @@ rm -rf "$dir" mkdir -p "$dir" cat > "$cache_file" << 'EOF' -Selected text. (2 lines) -Selected text 2. (2 lines) +1234 Selected text. (2 lines) +1235 Selected text 2. (2 lines) EOF cat > "$dir/$(cksum <<< 'Selected text. (2 lines)')" << 'EOF' @@ -70,7 +70,6 @@ EOF ### TESTS ### temp=$(mktemp) -trap 'rm -f -- "$temp"' EXIT /tmp/clipmenu --foo bar > "$temp" 2>&1 diff --git a/tests/test-perf b/tests/test-perf index 9a7a767..cde9e3a 100755 --- a/tests/test-perf +++ b/tests/test-perf @@ -1,6 +1,6 @@ #!/bin/bash -major_version=4 +major_version=5 msg() { printf '>>> %s\n' "$@" >&2 @@ -9,7 +9,7 @@ msg() { : "${CM_DIR="${XDG_RUNTIME_DIR-"${TMPDIR-/tmp}"}"}" dir=$CM_DIR/clipmenu.$major_version.$USER -cache_file=$dir/line_cache +cache_file=$dir/line_cache_primary log=$(mktemp) tim=$(mktemp) @@ -62,7 +62,7 @@ if ! (( NO_RECREATE )); then ) read -r first_line_raw <<< "$data" printf -v first_line '%s (%s lines)\n' "$first_line_raw" "$num_lines" - printf '%s' "$first_line" >> "$cache_file" + printf '%d %s' "$i" "$first_line" >> "$cache_file" fn=$dir/$(cksum <<< "$first_line") printf '%s' "$data" > "$fn" done