Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] use wildcard to check test outputs #3

Merged
merged 2 commits into from
May 30, 2018
Merged

[WIP] use wildcard to check test outputs #3

merged 2 commits into from
May 30, 2018

Conversation

qti3e
Copy link
Contributor

@qti3e qti3e commented May 29, 2018

No description provided.

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you! I have a few comments...

wildcard.go Outdated

var WILDCARD = []byte("[WILDCARD]")

func Wildcard(pattern []byte, text []byte) bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be better inside the util.go file and tests in util_test.go. And it should be lowercase (not exported).

wildcard_test.go Outdated
return Wildcard([]byte(a), []byte(b))
}

func TestWildcard(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Move this to util_test.go

@@ -78,6 +85,7 @@ func deno(inputFn string) (actual []byte, cachedir string, err error) {
var out bytes.Buffer
cmd.Stdout = &out
err = cmd.Run()
cmd.Wait()
Copy link
Member

@ry ry May 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes. Was this causing a race condition?
Edit: I think this does nothing. Run already waits.

@@ -57,10 +58,16 @@ func checkOutput(t *testing.T, outFile string) {
}

actual, _, err := deno(jsFile)
fmt.Println(jsFile)
fmt.Println(string(actual))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

@qti3e
Copy link
Contributor Author

qti3e commented May 29, 2018

@ry there is a bug which lays down somewhere else rather than this pr, the test result shows that deno() can't read stdout of ./deno testdata/013_async_throw.ts:
https://travis-ci.com/ry/deno/builds/74769626#L5349

@CLAassistant
Copy link

CLAassistant commented May 30, 2018

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've solved the bug you were having and made some other fix ups - pushed to your branch: qti3e/deno@d26704a

I will squash it all into one commit when landing.

Thanks Parsa!

util.go Outdated

var WILDCARD = []byte("[WILDCARD]")

func wildcard(pattern []byte, text []byte) bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should operate on strings instead of byte arrays?

@qti3e
Copy link
Contributor Author

qti3e commented May 30, 2018

My pleasure Ryan! (thanks for fixups btw!)

@ry ry merged commit 2242c6c into denoland:master May 30, 2018
@qti3e qti3e deleted the q/wildcard branch May 30, 2018 13:11
piscisaureus added a commit that referenced this pull request Oct 26, 2021
piscisaureus added a commit that referenced this pull request Oct 26, 2021
piscisaureus added a commit that referenced this pull request Oct 26, 2021
willnewby added a commit that referenced this pull request Apr 19, 2023
willnewby added a commit that referenced this pull request Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants