test rclone-args
# Pass generic flags to rclone under test using as an example
# the --size-only flag, which changes the meaning of operations.

# force specific modification time since file time is lost through git
touch-glob 2001-01-02 {datadir/} *

test initial bisync
bisync resync checksum

test place newer files on both paths
copy-file {datadir/}file1.txt {path1/}
copy-file {datadir/}file2.txt {path2/}
copy-file {datadir/}file20.txt {path1/}subdir
copy-file {datadir/}file21.txt {path2/}subdir

# re-touch dest to avoid race conditions with parallel tests
touch-glob 2001-01-02 {path1/} file1.txt
touch-glob 2001-01-02 {path2/} file2.txt
touch-glob 2001-01-02 {path1/}subdir/ file20.txt
touch-glob 2001-01-02 {path2/}subdir/ file21.txt

test run bisync with custom options
bisync checksum

touch-glob 2007-07-23 {datadir/} *

copy-file {datadir/}file1.txt {path1/}
copy-file {datadir/}file2.txt {path2/}
copy-file {datadir/}file20.txt {path1/}subdir
copy-as {datadir/}file21.txt {path2/} file1.txt

# re-touch dest to avoid race conditions with parallel tests
touch-glob 2007-07-23 {path1/} file1.txt
touch-glob 2007-07-23 {path2/} file2.txt
touch-glob 2007-07-23 {path1/}subdir/ file20.txt
touch-glob 2007-07-23 {path2/}subdir/ file21.txt

bisync size-only
bisync resync

copy-file {datadir/}file1.txt {path1/}
copy-file {datadir/}file2.txt {path2/}
copy-file {datadir/}file20.txt {path1/}subdir
copy-file {datadir/}file21.txt {path2/}subdir

# re-touch dest to avoid race conditions with parallel tests
touch-glob 2007-07-23 {path1/} file1.txt
touch-glob 2007-07-23 {path2/} file2.txt
touch-glob 2007-07-23 {path1/}subdir/ file20.txt
touch-glob 2007-07-23 {path2/}subdir/ file21.txt

bisync ignore-size

bisync resync compare-all

copy-as {datadir/}file21.txt {path2/} file2.txt

touch-glob 2023-08-26 {datadir/} *

copy-file {datadir/}file1.txt {path1/}

copy-file {datadir/}file20.txt {path1/}subdir
copy-file {datadir/}file21.txt {path2/}subdir

# re-touch dest to avoid race conditions with parallel tests
touch-glob 2007-07-23 {path2/} file2.txt
touch-glob 2023-08-26 {path1/} file1.txt
touch-glob 2023-08-26 {path1/}subdir/ file20.txt
touch-glob 2023-08-26 {path2/}subdir/ file21.txt

bisync compare-all