pijul_org / pijul

tests

By blabla on February 27, 2018
This patch is not signed.
69FSXS1UWZwqQ5AdmiBQeBtYK2B6UtZALQfnzsVdRaMCaQEpEaiqoBwBao6PeL2GphzwTCxYEiz71h7rg75L3w6P
This patch is in the following branches:
latest
master
testing



























































































    pijul clone a b
    out=$(mktemp)
    pijul status > $out
    assert_files_equal $out $BATS_TEST_DIRNAME/../expected/add_remove_file_unknown
    out=$(mktemp)
    pijul credit --repository subdir file.txt > $out
    head -n 1 $out | grep creator
    pijul record -a -n -A me -m 'create two files and dirs'
    out=$(mktemp)
    pijul status -s > $out
    diff $out $BATS_TEST_DIRNAME/../expected/conflicted-short-status
    run pijul delete-branch "b"
    assert_failure
    run pijul delete-branch "a"
    assert_success
    patch_file_b=$(mktemp)
    pijul patch --bin $last_patch_b > $patch_file_b
    file_txt_b=$(mktemp)
    cp file.txt $file_txt_b
    pijul apply < $patch_file_b
    assert_files_equal $file_txt_b file.txt
    export HOME=$(mktemp -d)
    mkdir -p $HOME
    REMOTE_PIJUL="$PIJUL_EXE" pijul key upload pe@localhost
    append_random b/toto
    cp b/toto b_toto
    cp a/toto /tmp/a_toto
    cp b/toto /tmp/b_toto
    cp b_toto b/toto
    RUST_LOG="libpijul::apply=debug" pijul pull -a --repository d c 2> /tmp/log
    cp d/toto /tmp/d_toto
    rm -Rf /tmp/c /tmp/d
    pijul clone c /tmp/c
    pijul clone d /tmp/d
    REMOTE_DIR=$(mktemp -d)
    OTHER_CLONE=$(mktemp -d)
    out=$(mktemp)
    pijul status -s > $out
    pijul status >> $out
    diff -u $out $BATS_TEST_DIRNAME/../expected/revert_move
    out=$(mktemp)
    pijul show-dependencies --repository subdir --depth 10000 > $out
    num_deps=$(grep -c -e "->" $out)
    out=$(mktemp)
    pijul_uncovered show-dependencies --repository subdir $HASH2 > $out
    num_deps=$(grep -c -e "->" $out)
    tmp_file=$(mktemp)
    pijul_uncovered show-dependencies --repository subdir $HASH > $tmp_file
    if [[ $(grep -c -e "->" $tmp_file) -ne 1 ]]; then
    out=$(mktemp)
    out=$(mktemp)
    pijul show-dependencies --repository subdir $lastest_patch > $out
    num_deps=$(grep -c -e "->" $out)
    out=$(mktemp)
    pijul_uncovered show-dependencies --repository subdir > $out
    num_deps=$(grep -c -e "->" $out)
    out=$(mktemp)
    pijul show-dependencies --repository subdir --depth 3 $HASH2 > $out
    ! grep -c -e "->" $out
    export HOME=$(mktemp -d)
    mkdir -p $HOME
@test "add/remove file unknown" {
    out=$(mktemp)
    pijul status > $out
    assert_files_equal $out $BATS_TEST_DIRNAME/../expected/add_remove_file_unknown
    out=$(mktemp)
    pijul status -s > $out
    diff -u $out $BATS_TEST_DIRNAME/../expected/short_status
    out=$(mktemp)	
    pijul status > $out
    diff -u $out $BATS_TEST_DIRNAME/../expected/long_status
    export HOME=$(mktemp -d)
    echo yd | pijul unrecord
    pijul_uncovered ls | grep "^file$"
    RUST_LOG="libpijul::output=debug" pijul_uncovered pull -a ../b 2> /tmp/out
    RUST_LOG="libpijul::record=debug" pijul_uncovered record -a -m "resolution" -A "Me" 2> /tmp/rec
    echo yd | RUST_LOG="libpijul::unrecord=debug" pijul unrecord 2> /tmp/log > /tmp/unrec
    # ls u/v/w/file
    # ls u/v/w/file
    pijul record --repository a -a -m msg -A me
    pijul_uncovered clone a c
    if [[ "$(ls -1 c | wc -l)" -ne "0" ]]; then
    make_single_file_repo a toto
    pijul remove --repository a toto
    pijul record --repository a -a -m msg -A me
    echo "blabla" >> b/toto
    pijul record --repository b -a -m msg -A me
    pijul pull -a --repository b a
    pijul pull -a --repository a b
    pijul remove --repository a toto
    pijul record --repository a -a -m msg -A me


  export PIJUL_SRC_DIR="$BATS_TEST_DIRNAME/../../.."
    export PIJUL_EXE="$PIJUL_SRC_DIR/target/debug/pijul"