<commit_before>#!/usr/bin/env bats
# vi:syntax=sh

load "$BATS_TEST_DIRNAME/fixtures.sh"

su_do() {
    if [ "$(id -u)" = "0" ]; then
        "$@"
    else
        sudo "$@"
    fi
}

setup_run >/dev/null 2>/dev/null

emit_snazzer_list_subvolumes_expected() {
    cat <<HERE
$BATS_TMPDIR/mnt
$BATS_TMPDIR/mnt/srv
$BATS_TMPDIR/mnt/srv/s p a c e
$BATS_TMPDIR/mnt/home
$BATS_TMPDIR/mnt/echo \`ls "/"; ls /;\`; ~!@#\$(ls)%^&*()_+-='[]'{}|:<>,./?

3 subvolumes excluded in $BATS_TMPDIR/mnt by $SNAZZER_SUBVOLS_EXCLUDE_FILE.
HERE
}

@test "snazzer --list-subvolumes" {
    run snazzer --list-subvolumes --all "$BATS_TMPDIR/mnt"
    [ "$status" = "0" ]
    [ "$output" = "$(emit_snazzer_list_subvolumes_expected)" ]
}

trap 'teardown_run >/dev/null 2>/dev/null' EXIT
<commit_msg>remove redundant func def in tests<commit_after>#!/usr/bin/env bats
# vi:syntax=sh

load "$BATS_TEST_DIRNAME/fixtures.sh"

setup_run >/dev/null 2>/dev/null

emit_snazzer_list_subvolumes_expected() {
    cat <<HERE
$BATS_TMPDIR/mnt
$BATS_TMPDIR/mnt/srv
$BATS_TMPDIR/mnt/srv/s p a c e
$BATS_TMPDIR/mnt/home
$BATS_TMPDIR/mnt/echo \`ls "/"; ls /;\`; ~!@#\$(ls)%^&*()_+-='[]'{}|:<>,./?

3 subvolumes excluded in $BATS_TMPDIR/mnt by $SNAZZER_SUBVOLS_EXCLUDE_FILE.
HERE
}

@test "snazzer --list-subvolumes" {
    run snazzer --list-subvolumes --all "$BATS_TMPDIR/mnt"
    [ "$status" = "0" ]
    [ "$output" = "$(emit_snazzer_list_subvolumes_expected)" ]
}

trap 'teardown_run >/dev/null 2>/dev/null' EXIT

{'fraction_non_alphanumeric': 0.19714479945615226, 'fraction_numerical': 0.006118286879673691, 'mean_word_length': 3.8741721854304636, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3174059', 'n_tokens_mistral': 713, 'n_tokens_neox': 695, 'n_words': 110}