-
Notifications
You must be signed in to change notification settings - Fork 27
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
Adds TestUASTGetLanguagesSuite/TestSameEnryLanguage #412
base: master
Are you sure you want to change the base?
Adds TestUASTGetLanguagesSuite/TestSameEnryLanguage #412
Conversation
This test ensures that the language label returned by enry is the same used by bblfsh Signed-off-by: Lou Marvin Caraig <[email protected]>
|
||
if langName == "Bash" { | ||
require.NotEqual(langName, detectedLang) | ||
t.Skip("TEST FAILURE IS A KNOWN ISSUE") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct? Isn't this due to the aliasing problem that we also have on engine? But shouldn't it be true also for C#
?
Signed-off-by: Lou Marvin Caraig <[email protected]>
Signed-off-by: Lou Marvin Caraig <[email protected]>
|
||
content, filename := suite.getContentAndFilename(langName) | ||
jsonRequest := fmt.Sprintf(`{ "content": "%s", "filename": "%s" }`, | ||
escapeForJSON(content), filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this manual escape you could do
j := struct {
Filename string
Content string
}{
Filename: filename,
Content: content,
}
b, _ := json.Marshal(j)
req, _ := http.NewRequest("POST", "/detect-lang", bytes.NewReader(b))
or export detectLangRequest
type and
j := handler.DetectLangRequest{
Filename: filename,
Content: content,
}
b, _ := json.Marshal(j)
req, _ := http.NewRequest("POST", "/detect-lang", bytes.NewReader(b))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the tip! Done here.
Signed-off-by: Lou Marvin Caraig <[email protected]>
Closes #314.
This test ensures that the language label returned by
enry
is the sameused by
bblfsh
.