Merge pull request #2202 from akruphi/readme
[far2l.git] / testing / tests / 0003-move-files.js
blobbf7673cd854ca4af7d9c07b2aef398f7b0f2d25f
1 mydir=WorkDir()
2 profile=mydir + "/profile"
3 left=mydir + "/left"
4 left_sub1=mydir + "/left/sub1"
5 left_sub2=mydir + "/left/sub2"
6 right=mydir + "/right"
7 MkdirsAll([profile, left, left_sub1, left_sub2, right], 0700)
9 left_files = [left + "/file1", left + "/file2", left + "/file3"]
10 left_sub_files = [left + "/sub1/aaa", left + "/sub1/bbb", left + "/sub1/ccc", left + "/sub2/ddd"]
11 Mkfiles(left_files, 0666, 0, 1024)
12 Mkfiles(left_sub_files, 0752, 10 * 1024 * 1024, 20 * 1024 * 1024)
14 left_items = [left + "/file1", left + "/file2", left + "/file3", left + "/sub1", left + "/sub2"]
15 right_items = [right + "/file1", right + "/file2", right + "/file3", right + "/sub1", right + "/sub2"]
16 left_hash = HashPathes(left_items, true, true, true, true, true)
18 StartApp(["--tty", "--nodetect", "--mortal", "-u", profile, "-cd", left, "-cd", right]);
19 ExpectString("Help - FAR2L", 0, 0, -1, -1, 10000);
21 status = AppStatus();
23 TypeEscape(10)
24 TypeDown()
25 TypeIns()
26 TypeIns()
27 TypeIns()
28 TypeIns()
29 TypeIns()
30 TypeFKey(6)
31 ExpectString("════ Rename/Move ═════", 0, 0, -1, -1, 10000)
32 TypeEnter()
33 for (i = 0; ; ++i) {
34         Sleep(100)
35         ExpectNoString("════ Rename/Move ═════", 0, 0, -1, -1, 10000)
36         right_hash = HashPathes(right_items, true, true, true, true, true)
37         if (right_hash == left_hash) {
38                 break
39         }
40         if (i == 100) {
41                 Log("Lhash: " + left_hash)
42                 Log("Rhash: " + right_hash)
43                 Panic("Hashes mismatched")
44         }
47 if (CountExisting(left_items) != 0) {
48         Panic("Some source files still existing!")
51 TypeFKey(10)
52 //TTYWrite("\x1b[21~");
53 ExpectString("Do you want to quit FAR?", 0, 0, -1, -1, 10000)
54 //TTYWrite("\r\n");
55 TypeEnter()
56 ExpectAppExit(0, 10000)