--- parser3/tests/157.html 2007/02/28 10:44:56 1.1
+++ parser3/tests/157.html 2018/05/10 23:06:11 1.4
@@ -1,12 +1,45 @@
-^try{
- ^file:copy[157.html;157.copy]
- ^if(-f "157.copy"){
+$sSrc[157.html]
+
+$stSrc[^file::stat[$sSrc]]
+
+$sCopy[newdir1/157.copy]
+$sMove[newdir2/157.move]
+^try-catch{
+ Copying file: ^file:copy[$sSrc;$sCopy]
+ ^if(-f $sCopy){
ok.
- ^file:delete[157.copy]
}{
no copy errors but target file doesn't exist.
}
-}{
- failed.
- $exception.handled(1)
-}
\ No newline at end of file
+}
+
+
+^if(! -f $sCopy){
+ ^return[]
+}
+
+^try-catch{
+ Appending file: ^file:copy[$sSrc;$sCopy; $.append(true) ]
+
+ $stCopy[^file::stat[$sCopy]]
+ ^if($stCopy.size == $stSrc.size*2){
+ ok.
+ }{
+ appended file size $stCopy.size is not double of source file size ${stSrc.size}.
+ }
+}
+
+
+^try-catch{
+ Moving file: ^file:move[$sCopy;$sMove]
+ ^if(-f $sMove){
+ ^if(-d ^file:dirname[$sCopy]){
+ moving ok but source dir still exist.
+ }{
+ ok.
+ }
+ ^file:delete[$sMove]
+ }{
+ no move errors but target file doesn't exist.
+ }
+}