Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Kata suggestions are meant to suggest improvements on the kata, you should use
question
label instead.Based on your latest code, I get this error -->
TypeError: Opsys.create is not a constructor
. Clearly, you are not instantiating the class correctly and everything should be placed in the constructor (including theversion
) andmajor
,minor
&&patch
values.OP solved it, closing. Based on the error message, seems like you are trying to parse a non-digit character into integer
Really sorry, I didn't know that I had tried to attempt this kata a long period back.
That code was mine actually :/
My bad!
Thanks for the reply!
The initial solution in python does not have any function body for
__init__
, I'm not sure where you're getting that from.That said, you should never raise a
BaseException
. The exact exception type doesn't matter for this kata, but it should be a concrete type, not the base class. Tryraise ValueError(...)
, it will fix your issue.Hi!
The author has given the following code in the object constructor in the Python Solution's preloaded code:
Now my solution works for all the fixed tests, however Test 7 Exception Calls is just not passing :c
I'm handling the rollback error as well
But it's stopping at the error I've just written above in the code.
What could be the issue?
P.S. I'm getting this error:
I'd appreciate your help!
I'm getting a critical error when testing exceptions cases, in my code i'm calling "throw VersionException("Error occured while parsing version!");"
without knowing how VersionException is defined i dont realize what is happening, any clue? thanks in advance
log:
UndefinedBehaviorSanitizer:DEADLYSIGNAL
==1==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f4f4e314afc bp 0x000002994ed0 sp 0x7ffc95d256b8 T1)
==1==The signal is caused by a READ memory access.
==1==Hint: address points to the zero page.
==1==WARNING: invalid path to external symbolizer!
==1==WARNING: Failed to use and restart external symbolizer!
#0 0x7f4f4e314afb (/lib/x86_64-linux-gnu/libc.so.6+0x18eafb)
#1 0x7f4f4ecf37dc (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x13d7dc)
#2 0x42e4e2 (/workspace/test+0x42e4e2)
#3 0x428f1e (/workspace/test+0x428f1e)
#4 0x4288bd (/workspace/test+0x4288bd)
#5 0x4285ab (/workspace/test+0x4285ab)
#6 0x431735 (/workspace/test+0x431735)
#7 0x427b8d (/workspace/test+0x427b8d)
#8 0x7f4f4e1a7c86 (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
#9 0x404be9 (/workspace/test+0x404be9)
UndefinedBehaviorSanitizer can not provide additional info.
==1==ABORTING
Hi!
The Random tests returns:
new VersionManager("47.40.22").patch().rollback().minor().minor().rollback().patch().major().major() ==> expected: <49.0.0> but was: <2.0.0>
but when I execute this code in local mode, it returns the correct and expected result
<49.0.0>
.Could you help me, please? Thanks!
I added some more assertions in sample and fixed tests which should show where your solution fails.
The problem is that since all the version methods operate on the same instance,
rollback()
also should alter theVersionManager
instance. Your solution returns another instance onrollback()
which works with chaining but not with separate method call like the random tests are performing.It's difficult to tell what is wrong with your solution without seeing your solution.
Because it's returning the expected value (<51.0.0>), not the value that the "randomTests" method is telling that it's returning (<51.1.0>)
But how do you know that your local test is correct?
It's difficult to tell what is wrong with your solution without seeing your solution.
Hi,
The "randomTests" method of "VersionManagerTest" class (VersionManagerTest.randomTests(VersionManagerTest.java:159)) has some issue because is returning errors like:
"org.opentest4j.AssertionFailedError: new VersionManager("50").minor().major().minor().rollback() ==> expected: <51.0.0> but was: <51.1.0>"
but when I execute that code in local it returns the correct and expected result (in this case <51.0.0>), so it shouldn't be returning that error.
Could you have a look please? Thx!
Should be fixed.
for throw exception you just need to type "throw VersionException("Error occured while parsing version!");"
because it already have built-in VersionException Class for tester. Means to submit you dont have to use try and catch block. I hope my explaination is clear, sorry for my broken english
Loading more items...