Closed verakohh closed 2 months ago
Maybe you could set an assert false;
to the start of the run method to see if the program crashes at the start of the program?
public String run() {
assert false : "assert works";
String greeting = ui.displayWelcomeMessage();
return greeting;
}
i get the above error when i insert it into my file.
Are you running with gradle? Did you add this
run {
enableAssertions = true
}
to your build.gradle file
Oh i didnt add that but after i did and ran with gradle, i did get an assertion error as one of the errors.
Thank you so much!! @winstonlimjy
Hi! How do i know if my assertions are working after setting them up?
I've added the -ea VM option for my ip[run] but when i run the code below and make a new task, there are no errors shown. I'm not sure if it's not set up properly or if i'm not applying the assertions correctly.