2014-05-29 02:50:39 -04:00
|
|
|
; Insert long environment variables [will be truncated to NSTRING - 1 (127)]
|
2014-06-03 23:32:50 -04:00
|
|
|
insert-string &env PATH
|
|
|
|
newline
|
2014-05-29 02:50:39 -04:00
|
|
|
insert-string $PATH
|
|
|
|
newline
|
2014-06-04 01:51:33 -04:00
|
|
|
insert-string &cat $PATH $PATH
|
|
|
|
newline
|
2014-06-03 23:32:50 -04:00
|
|
|
set %mypath $PATH
|
|
|
|
insert-string %mypath
|
|
|
|
newline
|
|
|
|
insert-string &cat "Length of $PATH: " &len $PATH
|
|
|
|
newline
|
2014-05-29 02:50:39 -04:00
|
|
|
; Insert string with escaped characters
|
|
|
|
insert-string "hello, world~n"
|
|
|
|
newline
|
2014-06-04 01:51:33 -04:00
|
|
|
; Insert 512 long token [will be truncated to sizeof istring buffer - 2 (510)]
|
|
|
|
insert-string 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
|
|
|
|
newline
|
|
|
|
; Insert 512 long quoted string [will be truncated to sizeof istring buffer - 3 (509)]
|
|
|
|
insert-string "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"
|
|
|
|
newline
|
2014-05-29 02:50:39 -04:00
|
|
|
; Insert long quoted string [will be truncated to NSTRING - 2 (126)]
|
|
|
|
insert-string "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
|
|
|
|
next-line
|
|
|
|
; Insert long tokens [will be truncated to NSTRING - 1 (127)]
|
|
|
|
insert-string 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
|
|
|
next-line
|
|
|
|
insert-string _________1_________2_________3_________4_________5_________6_________7_________8_________9_________0_________1_________2_________3
|
|
|
|
next-line
|
|
|
|
; Create and insert string variable until size exceed string limit [will be truncated to NSTRING - 1 (127)
|
|
|
|
set %nam 123
|
|
|
|
set %expect &len %nam
|
|
|
|
!while &equ &len %nam %expect
|
|
|
|
insert-string %nam
|
|
|
|
newline
|
|
|
|
set %nam &cat %nam %nam
|
|
|
|
set %expect &tim %expect 2
|
|
|
|
!endwhile
|
|
|
|
insert-string %nam
|
|
|
|
newline
|
|
|
|
insert-string &cat "Actual: " &len %nam
|
|
|
|
newline
|
|
|
|
insert-string &cat "Expected: " %expect
|
|
|
|
newline
|
|
|
|
; Use the variable as filename [will be truncated to NFILEN - 1 (79)]
|
|
|
|
write-file %nam
|
|
|
|
insert-string &cat "Filename: " $cfname
|
|
|
|
newline
|
|
|
|
insert-string "Filename length: "
|
|
|
|
insert-string &len $cfname
|
2014-06-03 03:45:41 -04:00
|
|
|
end-of-file
|
|
|
|
; Create a line longer than 1 kill block (250), 2 * 127 + 21 = 255
|
|
|
|
insert-string 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
|
|
|
insert-string 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
|
|
|
insert-string "#12345678901234567890"
|
|
|
|
; kill and yank
|
|
|
|
beginning-of-line
|
|
|
|
kill-to-end-of-line
|
2014-06-03 23:32:50 -04:00
|
|
|
kill-to-end-of-line
|
|
|
|
yank
|
2014-06-03 03:45:41 -04:00
|
|
|
yank
|
|
|
|
; insert kill variable (up to 127 characters), was 25 before fix
|
|
|
|
insert-string $kill
|
2014-05-29 02:50:39 -04:00
|
|
|
save-file
|
|
|
|
beginning-of-file
|
2014-06-04 01:51:33 -04:00
|
|
|
set-mark
|
|
|
|
end-of-file
|
|
|
|
copy-region
|
|
|
|
insert-string $kill
|