Skip to content

Add symbol baseliner #191

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

Merged
merged 15 commits into from
Jan 8, 2025
Merged

Add symbol baseliner #191

merged 15 commits into from
Jan 8, 2025

Conversation

gabritto
Copy link
Member

No description provided.

@@ -19,12 +19,6 @@ import (
// IO
const harnessNewLine = "\r\n"

var (
Copy link
Member Author

Choose a reason for hiding this comment

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

Moved to internal/testutil/baseline/util.go

@gabritto gabritto marked this pull request as ready for review January 6, 2025 19:56
@@ -1123,7 +1123,7 @@ func IsDeclaration(node *Node) bool {

// True if `name` is the name of a declaration node
func IsDeclarationName(name *Node) bool {
return !IsSourceFile(name) && !IsBindingPattern(name) && IsDeclaration(name.Parent)
return !IsSourceFile(name) && !IsBindingPattern(name) && IsDeclaration(name.Parent) && name.Parent.Name() == name
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a bug fix.

@@ -15,11 +15,11 @@ type Options struct {

const NoContent = "<no content>"

func Run(t testing.TB, fileName string, actual string, opts Options) {
func Run(t *testing.T, fileName string, actual string, opts Options) {
Copy link
Member Author

@gabritto gabritto Jan 6, 2025

Choose a reason for hiding this comment

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

Had to make this change from testing.TB to testing.T because I wanted to use t.Run in one symbol baseline function and so I changed it everywhere else, too.

@@ -253,19 +246,6 @@ func iterateErrorBaseline(t testing.TB, inputFiles []*TestFile, inputDiagnostics
return result
}

func checkDuplicatedFileName(resultName string, dupeCase map[string]int) string {
Copy link
Member Author

Choose a reason for hiding this comment

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

I realized this was essentially unused in the old test infra.

@jakebailey
Copy link
Member

Is there a test we could write for this "now" to verify that it works?

@jakebailey
Copy link
Member

Ah, #115 seems to include it.

Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
@gabritto gabritto enabled auto-merge (squash) January 8, 2025 03:12
@gabritto gabritto merged commit 07a5e04 into main Jan 8, 2025
12 checks passed
@gabritto gabritto deleted the gabritto/symbolbaseline branch January 8, 2025 03:25
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.

2 participants