-
Notifications
You must be signed in to change notification settings - Fork 0
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
Adding new syntax tests #1
base: master
Are you sure you want to change the base?
Conversation
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.
@CelsoSimoes The PR looks good, but there are some changes that need to be done. Mostly removing comments and commented code.
Also, a person should be able to tell what is being tested just by looking at the test case. What is error-1
inside syntax-error
folder? Can you give it a more descriptive name? What about the others?
@@ -0,0 +1,16 @@ | |||
import Syntax; | |||
// Esse teste PASSA. (Baseado no WrongName) |
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.
remove the comments
src/test/kotlin/VisitorTest.kt
Outdated
@@ -36,4 +36,48 @@ class VisitorTest { | |||
assertEquals("undefined name: WrongName::bob", exception.message) | |||
|
|||
} | |||
|
|||
@Test | |||
@DisplayName("Should return a null pointer Error") // kotlin.KotlinNullPointerException |
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.
Give it a more descriptive name. What is this test case testing?
src/test/kotlin/VisitorTest.kt
Outdated
val file = "src/test/fixtures/syntax-error/error-1/Main.hp" | ||
val priority = listOf("Actors", "Actions", "Resources") | ||
val exception = assertFailsWith<Exception> { IR.generate(file, priority) } | ||
assertEquals(null, exception.message) |
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.
Errors should be handled with a descriptive message instead of a not cool KotlinNullPointerException
. What would be a good message that make explicit the error that is occurring?
src/test/kotlin/VisitorTest.kt
Outdated
fun shouldReturnSyntaxError2() { | ||
val file = "src/test/fixtures/syntax-error/error-2/Main.hp" | ||
val priority = listOf("Actors", "Actions", "Resources") | ||
//val exception = assertFailsWith<Exception> { IR.generate(file, priority) } |
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.
remove comments
src/test/kotlin/VisitorTest.kt
Outdated
} | ||
|
||
@Test | ||
@DisplayName("Should DENY Alice Reads CCN") // Or Should return a Syntax Error |
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 testing a syntax error? which one?
Done:
What's next:
|
* build(docker): Docker file created * build(script): Build script DONE * fix(gitignore): removign unecessary directories * fix(comments): Removing unecessary comments
New regression tests; attempt to find edge cases.