-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from pldubouilh/mv
Mv
- Loading branch information
Showing
8 changed files
with
274 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,19 +65,19 @@ func testDefaults(t *testing.T, url string) string { | |
t.Fatal("error header") | ||
} | ||
|
||
if !strings.Contains(bodyStr, `<a href="hols">hols/</a>`) { | ||
if !strings.Contains(bodyStr, `href="hols">hols/</a>`) { | ||
t.Fatal("error hols folder") | ||
} | ||
|
||
if !strings.Contains(bodyStr, `<a href="[email protected]%20%2840%25%29">[email protected] (40%)/</a>`) { | ||
if !strings.Contains(bodyStr, `href="[email protected]%20%2840%25%29">[email protected] (40%)/</a>`) { | ||
t.Fatal("error [email protected] (40%) folder") | ||
} | ||
|
||
if !strings.Contains(bodyStr, `<a href="%E4%B8%AD%E6%96%87">δΈζ/</a>`) { | ||
if !strings.Contains(bodyStr, `href="%E4%B8%AD%E6%96%87">δΈζ/</a>`) { | ||
t.Fatal("error δΈζ folder") | ||
} | ||
|
||
if !strings.Contains(bodyStr, `<tr> <td><i class="btn icon icon-types icon-blank"></i></td> <td class="file-size"><code>0.2k</code></td> <td class="arrow"><i class="arrow-icon"></i></td> <td class="display-name"><a href="custom_mime_type.types">custom_mime_type.types</a></td> </tr>`) { | ||
if !strings.Contains(bodyStr, `<tr> <td><i class="btn icon icon-types icon-blank"></i></td> <td class="file-size"><code>0.2k</code></td> <td class="arrow"><i class="arrow-icon"></i></td> <td class="display-name"><a class="list-links" onclick="return onClickLink(event)" href="custom_mime_type.types">custom_mime_type.types</a></td> </tr>`) { | ||
t.Fatal("error row custom_mime_type") | ||
} | ||
|
||
|
@@ -110,28 +110,40 @@ func TestGetFolder(t *testing.T) { | |
|
||
// ~~~~~~~~~~~~~~~~~ | ||
fmt.Println("\r\n~~~~~~~~~~ test mkdir rpc") | ||
bodyStr = postJSON(t, "http://127.0.0.1:8001/rpc", `{"call":"mkdirp","args":["%2FAAA"]}`) | ||
bodyStr = postJSON(t, "http://127.0.0.1:8001/rpc", `{"call":"mkdirp","args":["/AAA"]}`) | ||
if !strings.Contains(bodyStr, `ok`) { | ||
t.Fatal("error returned value") | ||
} | ||
|
||
bodyStr = testDefaults(t, "http://127.0.0.1:8001/") | ||
if !strings.Contains(bodyStr, `<tr> <td><i class="btn icon icon-folder icon-blank"></i></td> <td class="file-size"><code>0</code></td> <td class="arrow"><i class="arrow-icon"></i></td> <td class="display-name"><a href="AAA">AAA/</a></td> </tr>`) { | ||
if !strings.Contains(bodyStr, `<tr> <td><i class="btn icon icon-folder icon-blank"></i></td> <td class="file-size"><code>0</code></td> <td class="arrow"><i class="arrow-icon"></i></td> <td class="display-name"><a class="list-links" onclick="return onClickLink(event)" href="AAA">AAA/</a></td> </tr>`) { | ||
t.Fatal("error new folder created") | ||
} | ||
|
||
// ~~~~~~~~~~~~~~~~~ | ||
fmt.Println("\r\n~~~~~~~~~~ test invalid mkdir rpc") | ||
bodyStr = postJSON(t, "http://127.0.0.1:8001/rpc", `{"call":"mkdirp","args":["..%2FBBB"]}`) | ||
bodyStr = postJSON(t, "http://127.0.0.1:8001/rpc", `{"call":"mkdirp","args":["../BBB"]}`) | ||
if !strings.Contains(bodyStr, `error`) { | ||
t.Fatal("error not returned") | ||
} | ||
|
||
bodyStr = postJSON(t, "http://127.0.0.1:8001/rpc", `{"call":"mkdirp","args":["%2F..%2FBBB"]}`) | ||
bodyStr = postJSON(t, "http://127.0.0.1:8001/rpc", `{"call":"mkdirp","args":["/../BBB"]}`) | ||
if !strings.Contains(bodyStr, `error`) { | ||
t.Fatal("error not returned") | ||
} | ||
|
||
// ~~~~~~~~~~~~~~~~~ | ||
fmt.Println("\r\n~~~~~~~~~~ test mv rpc") | ||
bodyStr = postJSON(t, "http://127.0.0.1:8001/rpc", `{"call":"mv","args":["/AAA", "/hols/AAA"]}`) | ||
if !strings.Contains(bodyStr, `ok`) { | ||
t.Fatal("error returned value") | ||
} | ||
|
||
bodyStr = testDefaults(t, "http://127.0.0.1:8001/") | ||
if strings.Contains(bodyStr, `<tr> <td><i class="btn icon icon-folder icon-blank"></i></td> <td class="file-size"><code>0</code></td> <td class="arrow"><i class="arrow-icon"></i></td> <td class="display-name"><a class="list-links" onclick="return onClickLink(event)" href="AAA">AAA/</a></td> </tr>`) { | ||
t.Fatal("error folder moved") | ||
} | ||
|
||
// ~~~~~~~~~~~~~~~~~ | ||
fmt.Println("\r\n~~~~~~~~~~ test post file") | ||
bodyStr = postDummyFile(t, "http://127.0.0.1:8001/post", "%2F%E1%84%92%E1%85%A1%20%E1%84%92%E1%85%A1") | ||
|
@@ -145,7 +157,7 @@ func TestGetFolder(t *testing.T) { | |
} | ||
|
||
bodyStr = testDefaults(t, "http://127.0.0.1:8001/") | ||
if !strings.Contains(bodyStr, `<tr> <td><i class="btn icon icon-αα ‘ αα ‘ icon-blank"></i></td> <td class="file-size"><code>0.0k</code></td> <td class="arrow"><i class="arrow-icon"></i></td> <td class="display-name"><a href="%E1%84%92%E1%85%A1%20%E1%84%92%E1%85%A1">αα ‘ αα ‘</a></td> </tr>`) { | ||
if !strings.Contains(bodyStr, `<tr> <td><i class="btn icon icon-αα ‘ αα ‘ icon-blank"></i></td> <td class="file-size"><code>0.0k</code></td> <td class="arrow"><i class="arrow-icon"></i></td> <td class="display-name"><a class="list-links" onclick="return onClickLink(event)" href="%E1%84%92%E1%85%A1%20%E1%84%92%E1%85%A1">αα ‘ αα ‘</a></td> </tr>`) { | ||
t.Fatal("error checking new file row") | ||
} | ||
|
||
|
Oops, something went wrong.