Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Evgeny Mandrikov
asm
Commits
4a30c739
Commit
4a30c739
authored
Apr 03, 2022
by
Eric Bruneton
Browse files
Add tests for the IllegalArgumentException message.
parent
e1d376d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
asm/src/test/java/org/objectweb/asm/TypeTest.java
View file @
4a30c739
...
...
@@ -126,7 +126,8 @@ class TypeTest implements Opcodes {
void
testGetTypeFromDescriptor_invalid
()
{
Executable
getType
=
()
->
Type
.
getType
(
"-"
);
assertThrows
(
IllegalArgumentException
.
class
,
getType
);
IllegalArgumentException
exception
=
assertThrows
(
IllegalArgumentException
.
class
,
getType
);
assertEquals
(
"Invalid descriptor: -"
,
exception
.
getMessage
());
}
@ParameterizedTest
...
...
@@ -187,6 +188,15 @@ class TypeTest implements Opcodes {
Duration
.
ofMillis
(
100
),
()
->
assertThrows
(
RuntimeException
.
class
,
getArgumentTypes
));
}
@Test
void
testGetArgumentTypesInvalidArgumentDescriptor
()
{
Executable
getArgumentTypes
=
()
->
Type
.
getArgumentTypes
(
"(Ljava/lang/String;-)V"
);
IllegalArgumentException
exception
=
assertThrows
(
IllegalArgumentException
.
class
,
getArgumentTypes
);
assertEquals
(
"Invalid descriptor: (Ljava/lang/String;-)V"
,
exception
.
getMessage
());
}
@Test
void
testGetReturnTypeFromDescriptor
()
{
assertEquals
(
Type
.
INT_TYPE
,
Type
.
getReturnType
(
"()I"
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment