forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use wildcard to check stack trace outputs (denoland#3)
- Loading branch information
Showing
10 changed files
with
141 additions
and
27 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
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
Downloading http:https://localhost:4545/testdata/subdir/print_hello.ts | ||
Hello | ||
success |
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
hello | ||
before error | ||
error Error: error | ||
at foo ([WILDCARD]testdata/async_error.ts:4:11) | ||
at eval ([WILDCARD]testdata/async_error.ts:6:1) | ||
at Object.eval [as globalEval] (<anonymous>) | ||
at execute (/main.js:[WILDCARD]) | ||
at FileModule.compileAndRun (/main.js:[WILDCARD]) | ||
at /main.js:[WILDCARD] | ||
at /main.js:[WILDCARD] |
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/main.js:[WILDCARD] | ||
throw _iteratorError; | ||
^ | ||
Error: bad | ||
at foo ([WILDCARD]testdata/error.ts:2:9) | ||
at bar ([WILDCARD]testdata/error.ts:6:3) | ||
at eval ([WILDCARD]testdata/error.ts:9:1) | ||
at Object.eval [as globalEval] (<anonymous>) | ||
at execute (../runtime.ts:[WILDCARD]) | ||
at FileModule.compileAndRun (../runtime.ts:[WILDCARD] |
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package deno | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
const exStackTrace = `hello | ||
before error | ||
error Error: error | ||
at foo (/Users/rld/go/src/github.com/ry/deno/testdata/013_async_throw.ts:4:11) | ||
at eval (/Users/rld/go/src/github.com/ry/deno/testdata/013_async_throw.ts:6:1) | ||
at Object.eval [as globalEval] (<anonymous>) | ||
at execute (/main.js:144781:15) | ||
at FileModule.compileAndRun (/main.js:144678:13) | ||
at /main.js:145161:13 | ||
at /main.js:15733:13` | ||
const exStackTracePattern = `hello | ||
before error | ||
error Error: error | ||
at foo ([WILDCARD]testdata/013_async_throw.ts:4:11) | ||
at eval ([WILDCARD]testdata/013_async_throw.ts:6:1) | ||
at Object.eval [as globalEval] (<anonymous>) | ||
at execute (/main.js:[WILDCARD]` | ||
|
||
func TestPatternMatch(t *testing.T) { | ||
if patternMatch("aa", "a") != false { | ||
t.Fatalf("Wrong resullt (1).") | ||
} | ||
if patternMatch("aaa[WILDCARD]b", "aaaxsdfdb") != true { | ||
t.Fatalf("Wrong resullt (2).") | ||
} | ||
if patternMatch("aab[WILDCARD]", "xsd") != false { | ||
t.Fatalf("Wrong resullt (3).") | ||
} | ||
if patternMatch("a[WILDCARD]b[WILDCARD]c", "abc") != true { | ||
t.Fatalf("Wrong resullt (4).") | ||
} | ||
if patternMatch("a[WILDCARD]b[WILDCARD]c", "axbc") != true { | ||
t.Fatalf("Wrong resullt (5).") | ||
} | ||
if patternMatch("a[WILDCARD]b[WILDCARD]c", "abxc") != true { | ||
t.Fatalf("Wrong resullt (6).") | ||
} | ||
if patternMatch("a[WILDCARD]b[WILDCARD]c", "axbxc") != true { | ||
t.Fatalf("Wrong resullt (7).") | ||
} | ||
if patternMatch("a[WILDCARD]b[WILDCARD]c", "abcx") != false { | ||
t.Fatalf("Wrong resullt (8).") | ||
} | ||
if patternMatch("a[WILDCARD][WILDCARD]c", "abc") != true { | ||
t.Fatalf("Wrong resullt (9).") | ||
} | ||
if patternMatch("a[WILDCARD][WILDCARD]c", "ac") != true { | ||
t.Fatalf("Wrong resullt (10).") | ||
} | ||
} | ||
|
||
func TestPatternMatchStackTrace(t *testing.T) { | ||
if patternMatch(exStackTracePattern, exStackTrace) != true { | ||
t.Fatalf("Wrong resullt (11).") | ||
} | ||
} |