#!/bin/sh
# -*- tcl -*-
# The next line is executed by /bin/sh, but not tcl \
exec tclsh "$0" ${1+"$@"}

# Test that appending to files with w>> works.

source scripts/term
start_vi

exec echo one > 1
exec echo two > 2

test 1 ":e 1\r"		1 0 "one"
test 2 ":w>>2\r:e! 2\r" 1 0 [list "two" "one" "~"]

# Other forms of spacing
exec echo two > 2
test 3 ":e 1\r"		1 0 "one"
test 4 ":w>> 2\r:w >>2\r:e 2\r"	1 0 [list "two" "one" "one" "~"]

# Forced forms with !
exec echo two > 2
test 5 ":e 1\r:w!>>2\r:w! >>2\r:w!>> 2\r:e 2\r"	1 0 [list "two" "one" "one" "one" "~"]

# Abbreviated forms

exec echo two > 2
test 5 ":e 1\r:wr!>>2\r:wri!>>2\r:writ!>>2\r:write!>>2\r:e 2\r"	1 0 [list "two" "one" "one" "one" "one" "~"]

exec rm 1 2

stop_vi

exit 0
