| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,4 +32,12 @@ export var test_file_exists_on_folder = function () { | |||
| 32 | 32 | } | |
| 33 | 33 | ||
| 34 | 34 | TKUnit.assertTrue(fs.File.exists(path), "File.exists() returned false for folder!"); | |
| 35 | - }; | ||
| 35 | + }; | ||
| 36 | + | ||
| 37 | + export var test_leading_slash_is_not_returned = function () { | ||
| 38 | + var parts = ["app", "tns_modules", "fileName"]; | ||
| 39 | + var expected = parts.join("/"); | ||
| 40 | + var path = fs.path.join(...parts); | ||
| 41 | + | ||
| 42 | + TKUnit.assertEqual(path, expected, "Leading slash should not be part of the path"); | ||
| 43 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -192,7 +192,7 @@ export class FileSystemAccess { | |||
| 192 | 192 | var dir = utils.ad.getApplicationContext().getCacheDir(); | |
| 193 | 193 | return dir.getAbsolutePath(); | |
| 194 | 194 | } | |
| 195 | - | ||
| 195 | + | ||
| 196 | 196 | public getCurrentAppPath(): string { | |
| 197 | 197 | return this.getLogicalRootPath() + "/app"; | |
| 198 | 198 | } | |
@@ -428,7 +428,7 @@ export class FileSystemAccess { | |||
| 428 | 428 | var file1 = new java.io.File(left); | |
| 429 | 429 | var file2 = new java.io.File(file1, right); | |
| 430 | 430 | ||
| 431 | - return file2.getAbsolutePath(); | ||
| 431 | + return file2.getPath(); | ||
| 432 | 432 | } | |
| 433 | 433 | ||
| 434 | 434 | public joinPaths(paths: string[]): string { | |
@@ -446,6 +446,6 @@ export class FileSystemAccess { | |||
| 446 | 446 | result = this.joinPath(result, paths[i]); | |
| 447 | 447 | } | |
| 448 | 448 | ||
| 449 | - return this.normalizePath(result); | ||
| 449 | + return result; | ||
| 450 | 450 | } | |
| 451 | 451 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments