Conversation
flavluc
left a comment
There was a problem hiding this comment.
@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) | |||
src/test/kotlin/VisitorTest.kt
Outdated
| } | ||
|
|
||
| @Test | ||
| @DisplayName("Should return a null pointer Error") // kotlin.KotlinNullPointerException |
There was a problem hiding this comment.
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.
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) } |
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.
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.