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

Update node_test.go with TestStaticNodeMatchRoute test case #64

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

WheeskyJack
Copy link
Contributor

Hi @vardius
this pr updates node_test.go with TestStaticNodeMatchRoute test case and fix typo in test case.

Update node_test.go with TestStaticNodeMatchRoute test case and fix typo in test case.
Comment on lines -21 to +34
t.Fatalf("Expecting: *mux.staticNode. Wrong node type: %T\n", node)
t.Fatalf("Expecting: *mux.regexpNode. Wrong node type: %T\n", node)
case *wildcardNode:
t.Fatalf("Expecting: *mux.staticNode. Wrong node type: %T\n", node)
t.Fatalf("Expecting: *mux.regexpNode. Wrong node type: %T\n", node)
}

node = NewNode("{lang}", 0)

switch node := node.(type) {
case *staticNode:
t.Fatalf("Expecting: *mux.staticNode. Wrong node type: %T\n", node)
t.Fatalf("Expecting: *mux.wildcardNode. Wrong node type: %T\n", node)
case *regexpNode:
t.Fatalf("Expecting: *mux.staticNode. Wrong node type: %T\n", node)
t.Fatalf("Expecting: *mux.wildcardNode. Wrong node type: %T\n", node)
Copy link
Owner

Choose a reason for hiding this comment

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

why change this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The error message is incorrect. The expected value should be wildcard,but it incorrectly states that the expected value is static. This issue is also present in the other error messages.

Copy link
Owner

Choose a reason for hiding this comment

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

ohh I see 👍🏻

@vardius vardius merged commit d124c05 into vardius:master Aug 26, 2024
2 checks passed
@WheeskyJack WheeskyJack deleted the WheeskyJack-patch-2 branch August 26, 2024 08:00
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