Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
uydwl
mjtest-tests
Commits
732844c4
Commit
732844c4
authored
Nov 14, 2018
by
Thomas Schmidt
Committed by
Johannes Bucher
Nov 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some semantic test case (valid & invalid ones)
parent
c3213646
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
132 additions
and
0 deletions
+132
-0
semantic/class_addition.invalid.mj
semantic/class_addition.invalid.mj
+5
-0
semantic/class_compare.invalid.mj
semantic/class_compare.invalid.mj
+5
-0
semantic/lvalue_operation_binary.invalid.mj
semantic/lvalue_operation_binary.invalid.mj
+10
-0
semantic/lvalue_operation_unary.invalid.mj
semantic/lvalue_operation_unary.invalid.mj
+7
-0
semantic/main_multiple_in_different_classes.invalid.mj
semantic/main_multiple_in_different_classes.invalid.mj
+11
-0
semantic/main_multiple_in_same_class_one_static_one_not.invalid.mj
...main_multiple_in_same_class_one_static_one_not.invalid.mj
+8
-0
semantic/main_parameter_different_name.java
semantic/main_parameter_different_name.java
+3
-0
semantic/method_multi_param_same_name.invalid.mj
semantic/method_multi_param_same_name.invalid.mj
+7
-0
semantic/return_valid_classType.java
semantic/return_valid_classType.java
+15
-0
semantic/shadowing_apocalypse.java
semantic/shadowing_apocalypse.java
+30
-0
semantic/system_shadowing_with_field.java
semantic/system_shadowing_with_field.java
+16
-0
semantic/system_shadowing_with_localVar.java
semantic/system_shadowing_with_localVar.java
+15
-0
No files found.
semantic/class_addition.invalid.mj
0 → 100644
View file @
732844c4
class Schuessel {
public static void main(String[] Schluessel) {
Schuessel schluessel = (new Schuessel()) + (new Schuessel());
}
}
\ No newline at end of file
semantic/class_compare.invalid.mj
0 → 100644
View file @
732844c4
class Glas {
public static void main(String[] glas) {
boolean ledlichtchen = (new Glas()) < (new Glas());
}
}
\ No newline at end of file
semantic/lvalue_operation_binary.invalid.mj
0 → 100644
View file @
732844c4
class IKEA {
public static void main(String[] baum) {
int a = 2;
int b = 5;
int c;
a = b;
a+(b) = c;
}
}
\ No newline at end of file
semantic/lvalue_operation_unary.invalid.mj
0 → 100644
View file @
732844c4
class IKEA {
public static void main(String[] baum) {
boolean a = true;
boolean c;
!a = c;
}
}
\ No newline at end of file
semantic/main_multiple_in_different_classes.invalid.mj
0 → 100644
View file @
732844c4
class Hello {
public static void main(String[] args) {
}
}
class World {
public static void main(String[] args) {
}
}
\ No newline at end of file
semantic/main_multiple_in_same_class_one_static_one_not.invalid.mj
0 → 100644
View file @
732844c4
class Hello {
public static void main(String[] args) {
}
public void main() {
}
}
\ No newline at end of file
semantic/main_parameter_different_name.java
0 → 100644
View file @
732844c4
class
Blume
{
public
static
void
main
(
String
[]
nudel
)
{}
}
\ No newline at end of file
semantic/method_multi_param_same_name.invalid.mj
0 → 100644
View file @
732844c4
class Juhuu {
public static void main(String[] teekochgeraet) {
/* :) */
}
public Juhuu jippii(int buch, int buch) {}
}
\ No newline at end of file
semantic/return_valid_classType.java
0 → 100644
View file @
732844c4
class
Origami
{
public
int
republic
;
}
class
Miau
{
public
static
void
main
(
String
[]
hustenbonbon
)
{
Origami
tasse
=
(
new
Miau
()).
klappe
(
4
);
}
public
Origami
klappe
(
int
baum
)
{
Origami
aaaaaaaa
=
new
Origami
();
aaaaaaaa
.
republic
=
baum
;
return
aaaaaaaa
;
}
}
\ No newline at end of file
semantic/shadowing_apocalypse.java
0 → 100644
View file @
732844c4
class
Baumwurzelextrakt
{
public
int
Baumwurzelextrakt
;
public
static
void
main
(
String
[]
Baumwurzelextrakt
)
{
Baumwurzelextrakt
[]
recursion
=
new
Baumwurzelextrakt
[
800
];
int
i
=
0
;
while
(
i
<
800
)
{
if
(
i
==
0
)
{
recursion
[
i
]
=
new
Baumwurzelextrakt
();
}
else
{
recursion
[
i
]
=
new
Baumwurzelextrakt
();
recursion
[
i
].
Baumwurzelextrakt
(
recursion
[
i
-
1
]);
}
i
=
1
+
i
;
}
}
public
Baumwurzelextrakt
Baumwurzelextrakt
(
Baumwurzelextrakt
keinBaumwurzelextrakt
)
{
{
int
Baumwurzelextrakt
=
5
;
this
.
Baumwurzelextrakt
=
Baumwurzelextrakt
+
this
.
Baumwurzelextrakt
;
}
{
Baumwurzelextrakt
Baumwurzelextrakt
=
new
Baumwurzelextrakt
();
Baumwurzelextrakt
(
new
Baumwurzelextrakt
());
}
return
null
;
}
}
\ No newline at end of file
semantic/system_shadowing_with_field.java
0 → 100644
View file @
732844c4
class
NotSystem
{
public
Out
System
;
public
static
void
main
(
String
[]
garage
)
{
}
public
void
rolle
()
{
System
.
out
.
println
(
5
);
}
}
class
Out
{
public
Out
out
;
public
void
println
(
int
haeuschen
)
{
/* fertig */
}
}
semantic/system_shadowing_with_localVar.java
0 → 100644
View file @
732844c4
class
System
{
public
Out
out
;
public
static
void
main
(
String
[]
garage
)
{
}
public
void
nochNeRolle
()
{
System
System
=
new
System
();
System
.
out
.
println
(
5
);
}
}
class
Out
{
public
void
println
(
int
haeuschen
)
{
/* fertig */
}
}
Write
Preview
Markdown
is supported
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