mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
Remove extension hack in ResolveModule.
This commit is contained in:
parent
e401d9e21b
commit
4f00218d6d
4 changed files with 7 additions and 13 deletions
5
os.go
5
os.go
|
@ -76,11 +76,6 @@ func ResolveModule(moduleSpecifier string, containingFile string) (
|
||||||
containingFile = SrcFileToUrl(containingFile)
|
containingFile = SrcFileToUrl(containingFile)
|
||||||
moduleSpecifier = SrcFileToUrl(moduleSpecifier)
|
moduleSpecifier = SrcFileToUrl(moduleSpecifier)
|
||||||
|
|
||||||
// Hack: If there is no extension, just add .ts
|
|
||||||
if path.Ext(moduleSpecifier) == "" {
|
|
||||||
moduleSpecifier = moduleSpecifier + ".ts"
|
|
||||||
}
|
|
||||||
|
|
||||||
logDebug("os.go ResolveModule after moduleSpecifier %s containingFile %s",
|
logDebug("os.go ResolveModule after moduleSpecifier %s containingFile %s",
|
||||||
moduleSpecifier, containingFile)
|
moduleSpecifier, containingFile)
|
||||||
|
|
||||||
|
|
|
@ -72,9 +72,8 @@ func TestResolveModule4(t *testing.T) {
|
||||||
path.Join(SrcDir, "unpkg.com/liltest@0.0.5/index.ts"))
|
path.Join(SrcDir, "unpkg.com/liltest@0.0.5/index.ts"))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestResolveModule5(t *testing.T) {
|
func TestResolveModuleExtensionsAintSpecial(t *testing.T) {
|
||||||
createDirs()
|
createDirs()
|
||||||
// Files in SrcDir should resolve to URLs.
|
|
||||||
moduleName, filename, err := ResolveModule(
|
moduleName, filename, err := ResolveModule(
|
||||||
"./util",
|
"./util",
|
||||||
path.Join(SrcDir, "unpkg.com/liltest@0.0.5/index.ts"))
|
path.Join(SrcDir, "unpkg.com/liltest@0.0.5/index.ts"))
|
||||||
|
@ -82,7 +81,7 @@ func TestResolveModule5(t *testing.T) {
|
||||||
t.Fatalf(err.Error())
|
t.Fatalf(err.Error())
|
||||||
}
|
}
|
||||||
AssertEqual(t, moduleName,
|
AssertEqual(t, moduleName,
|
||||||
"http://unpkg.com/liltest@0.0.5/util.ts")
|
"http://unpkg.com/liltest@0.0.5/util")
|
||||||
AssertEqual(t, filename,
|
AssertEqual(t, filename,
|
||||||
path.Join(SrcDir, "unpkg.com/liltest@0.0.5/util.ts"))
|
path.Join(SrcDir, "unpkg.com/liltest@0.0.5/util"))
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export { assert, assertEqual, equal } from "./util";
|
export { assert, assertEqual, equal } from "./util.ts";
|
||||||
|
|
||||||
export type TestFunction = () => void | Promise<void>;
|
export type TestFunction = () => void | Promise<void>;
|
||||||
|
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { test } from "./index";
|
import { test } from "./index.ts";
|
||||||
import { assert } from "./util";
|
import { assert } from "./util.ts";
|
||||||
import * as util from "./util";
|
import * as util from "./util.ts";
|
||||||
|
|
||||||
test(async function util_equal() {
|
test(async function util_equal() {
|
||||||
assert(util.equal("world", "world"));
|
assert(util.equal("world", "world"));
|
||||||
|
|
Loading…
Add table
Reference in a new issue