+rm -rf "$to2dir"
+$RSYNC -vvplrtH --copy-dest="$todir" "$fromdir/" "$to2dir/" \
+ | tee "$outfile"
+filter_outfile
+cat <<EOT >"$chkfile"
+./ is uptodate
+bar/ is uptodate
+bar/baz/ is uptodate
+bar/baz/rsync is uptodate
+foo/ is uptodate
+foo/config1 is uptodate
+foo/config2 is uptodate
+foo/extra => foo/config1
+foo/sym $is_uptodate
+EOT
+diff $diffopt "$chkfile" "$outfile" || test_fail "test 10 failed"
+
+rm -rf "$to2dir"
+$RSYNC -ivvplrtH --link-dest="$todir" "$fromdir/" "$to2dir/" \
+ | tee "$outfile"
+filter_outfile
+cat <<EOT >"$chkfile"
+cd$allspace ./
+cd$allspace bar/
+cd$allspace bar/baz/
+hf$allspace bar/baz/rsync
+cd$allspace foo/
+hf$allspace foo/config1
+hf$allspace foo/config2
+hf$allspace foo/extra => foo/config1
+$L$sym_dots foo/sym -> ../bar/baz/rsync
+EOT
+diff $diffopt "$chkfile" "$outfile" || test_fail "test 11 failed"
+
+rm -rf "$to2dir"
+$RSYNC -iplrtH --dry-run --link-dest=../to "$fromdir/" "$to2dir/" \
+ | tee "$outfile"
+cat - "$chkfile.extra" <<EOT >"$chkfile"
+EOT
+diff $diffopt "$chkfile" "$outfile" || test_fail "test 12 failed"
+
+rm -rf "$to2dir"
+$RSYNC -iplrtH --link-dest=../to "$fromdir/" "$to2dir/" \
+ | tee "$outfile"
+cat - "$chkfile.extra" <<EOT >"$chkfile"
+EOT
+diff $diffopt "$chkfile" "$outfile" || test_fail "test 13 failed"
+
+rm -rf "$to2dir"
+$RSYNC -vvplrtH --link-dest="$todir" "$fromdir/" "$to2dir/" \
+ | tee "$outfile"
+filter_outfile
+cat <<EOT >"$chkfile"
+./ is uptodate
+bar/ is uptodate
+bar/baz/ is uptodate
+bar/baz/rsync is uptodate
+foo/ is uptodate
+foo/config1 is uptodate
+foo/config2 is uptodate
+foo/extra is uptodate
+foo/sym $is_uptodate
+EOT
+diff $diffopt "$chkfile" "$outfile" || test_fail "test 14 failed"
+
+rm -rf "$to2dir"
+$RSYNC -ivvplrtH --compare-dest="$todir" "$fromdir/" "$to2dir/" \
+ | tee "$outfile"
+filter_outfile
+cat <<EOT >"$chkfile"
+cd$allspace ./
+cd$allspace bar/
+cd$allspace bar/baz/
+.f$allspace bar/baz/rsync
+cd$allspace foo/
+.f$allspace foo/config1
+.f$allspace foo/config2
+.f$allspace foo/extra
+$L_sym_dots foo/sym -> ../bar/baz/rsync
+EOT
+diff $diffopt "$chkfile" "$outfile" || test_fail "test 15 failed"
+
+rm -rf "$to2dir"
+$RSYNC -iplrtH --compare-dest="$todir" "$fromdir/" "$to2dir/" \
+ | tee "$outfile"
+cat - "$chkfile.extra" <<EOT >"$chkfile"
+EOT
+diff $diffopt "$chkfile" "$outfile" || test_fail "test 16 failed"
+
+rm -rf "$to2dir"
+$RSYNC -vvplrtH --compare-dest="$todir" "$fromdir/" "$to2dir/" \
+ | tee "$outfile"
+filter_outfile
+cat <<EOT >"$chkfile"
+./ is uptodate
+bar/ is uptodate
+bar/baz/ is uptodate
+bar/baz/rsync is uptodate
+foo/ is uptodate
+foo/config1 is uptodate
+foo/config2 is uptodate
+foo/extra is uptodate
+foo/sym $is_uptodate
+EOT
+diff $diffopt "$chkfile" "$outfile" || test_fail "test 17 failed"
+