Annotation of parser3/tests/345.html, revision 1.3
1.1 moko 1: @main[]
2: $sDir[outputs/345]
3: $dDir[outputs/345.test]
4: $f[test.txt]
5:
6: $s[test]
7: ^s.save[$sDir/$f]
8: ^file:move[$sDir/$f;$dDir/$f; $.keep-empty-dirs(true) ]
9:
10: ^file:delete[$sDir/404.txt; $.exception(false) ]
11: ^file:delete[$dDir/$f; $.keep-empty-dirs(true) ]
12:
13: 1. ^if(-d $sDir){ok}
14: 2. ^if(-d $dDir){ok}
15: 3. ^if(-d "$dDir/$f"){}{ok}
16:
17: ^s.save[$sDir/$f]
18: ^file:move[$sDir/$f;$dDir/$f]
19: ^file:delete[$dDir/$f]
20:
21: 4. ^if(-d $sDir){}{ok}
22: 5. ^if(-d $dDir){}{ok}
23:
1.2 moko 24: 6. ^try-catch{ ^file:delete[name; $.no-such-option[] ] }
25: 7. ^try-catch{ ^file:move[name;name; $.no-such-option[] ] }
1.3 ! moko 26:
! 27: ^scenario[8;file;file]
! 28: ^scenario[9;dir;empty]
! 29: ^scenario[10;dir;dir]
! 30:
! 31: ^remove[11;empty]
! 32: ^remove[12;dir]
! 33: ^remove[13;file]
! 34: ^remove[14;none]
! 35: 15. ^try{^file:rmdir[$dDir/x]}{$exception.handled(1)$exception.type} ^file:rmdir[$dDir/x; $.exception(false) ]quiet
! 36: 16. ^try-catch{ ^file:rmdir[name; $.no-such-option[] ] }
! 37:
! 38: @scenario[n;from;to]
! 39: ^make[$from;$sDir/x;new]
! 40: ^make[$to;$dDir/x;old]
! 41: ${n}. ${from} -> ${to}: ^try{^file:move[$sDir/x;$dDir/x]moved}{$exception.handled(1)failed}, source ^state[$sDir/x], target ^state[$dDir/x]<br />
! 42: ^clean[$sDir/x]
! 43: ^clean[$dDir/x]
! 44:
! 45: @remove[n;kind]
! 46: ^make[$kind;$dDir/x;old]
! 47: ${n}. rmdir ${kind}: ^try{^file:rmdir[$dDir/x]removed}{$exception.handled(1)failed}, now ^state[$dDir/x]<br />
! 48: ^clean[$dDir/x]
! 49:
! 50: @make[kind;path;text]
! 51: ^switch[$kind]{
! 52: ^case[file]{^text.save[$path]}
! 53: ^case[dir]{^text.save[$path/$f]}
! 54: ^case[empty]{^text.save[$path/$f]^file:delete[$path/$f; $.keep-empty-dirs(true) ]}
! 55: }
! 56:
! 57: @state[path][loaded]
! 58: ^if(-d $path){dir(^state[$path/$f])}{^if(-f $path){$loaded[^file::load[text;$path]]$loaded.text}{-}}
! 59:
! 60: @clean[path]
! 61: ^file:delete[$path; $.exception(false) ]
! 62: ^file:delete[$path/$f; $.exception(false) ]
! 63: ^file:rmdir[$path; $.exception(false) ]
E-mail: