Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs2-22wi
lab09
Commits
82fb4a51
Commit
82fb4a51
authored
3 years ago
by
Snigdha Saha
Browse files
Options
Download
Email Patches
Plain Diff
test update
parent
738409e0
master
No related merge requests found
Pipeline
#63146
passed with stage
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/edu/caltech/cs2/helpers/Inspection.java
+2
-2
tests/edu/caltech/cs2/helpers/Inspection.java
tests/edu/caltech/cs2/lab08/Problem1Tests.java
+1
-1
tests/edu/caltech/cs2/lab08/Problem1Tests.java
tests/edu/caltech/cs2/lab08/Problem2Tests.java
+1
-1
tests/edu/caltech/cs2/lab08/Problem2Tests.java
with
4 additions
and
4 deletions
+4
-4
tests/edu/caltech/cs2/helpers/Inspection.java
View file @
82fb4a51
...
...
@@ -24,8 +24,8 @@ import java.util.List;
public
class
Inspection
{
private
static
String
arrayRegex1
=
"\\s*
int
\\s*\\[\\]\\s*.*\\s*=\\s*new
int
\\[.*\\]\\s*;"
;
private
static
String
arrayRegex2
=
".*\\s*=\\s*new
int
\\[.*\\]\\s*;"
;
private
static
String
arrayRegex1
=
"\\s*
.*
\\s*\\[\\]\\s*.*\\s*=\\s*new
.*
\\[.*\\]\\s*;"
;
private
static
String
arrayRegex2
=
".*\\s*=\\s*new
.*
\\[.*\\]\\s*;"
;
private
static
String
getUsageOf
(
List
<
String
>
regexps
,
List
<?
extends
Node
>
codeObjects
)
{
for
(
Node
d
:
codeObjects
)
{
...
...
This diff is collapsed.
Click to expand it.
tests/edu/caltech/cs2/lab08/Problem1Tests.java
View file @
82fb4a51
...
...
@@ -37,7 +37,7 @@ public class Problem1Tests {
@DisplayName
(
"Import Tests"
)
@Test
public
void
testForInvalidClasses
()
{
List
<
String
>
regexps
=
List
.
of
(
"java\\.lang\\.reflect"
,
"java\\.io"
,
"javax\\.swing"
,
"java\\.util"
,
"\\s*
int
\\s*\\[\\]\\s*.*\\s*=\\s*new
int
\\[.*\\]\\s*;"
,
".*\\s*=\\s*new
int
\\[.*\\]\\s*;"
);
List
<
String
>
regexps
=
List
.
of
(
"java\\.lang\\.reflect"
,
"java\\.io"
,
"javax\\.swing"
,
"java\\.util"
,
"\\s*
.*
\\s*\\[\\]\\s*.*\\s*=\\s*new
.*
\\[.*\\]\\s*;"
,
".*\\s*=\\s*new
.*
\\[.*\\]\\s*;"
);
Inspection
.
assertNoImportsOf
(
PROBLEM_1_SOURCE
,
regexps
);
Inspection
.
assertNoUsageOf
(
PROBLEM_1_SOURCE
,
regexps
);
}
...
...
This diff is collapsed.
Click to expand it.
tests/edu/caltech/cs2/lab08/Problem2Tests.java
View file @
82fb4a51
...
...
@@ -20,7 +20,7 @@ public class Problem2Tests {
@DisplayName
(
"Import & Usage Tests"
)
@Test
public
void
testForInvalidClassesAndDataStructures
()
{
List
<
String
>
regexps
=
List
.
of
(
"java\\.lang\\.reflect"
,
"java\\.io"
,
"javax\\.swing"
,
"java\\.util"
,
"\\s*
int
\\s*\\[\\]\\s*.*\\s*=\\s*new
int
\\[.*\\]\\s*;"
,
".*\\s*=\\s*new
int
\\[.*\\]\\s*;"
);
List
<
String
>
regexps
=
List
.
of
(
"java\\.lang\\.reflect"
,
"java\\.io"
,
"javax\\.swing"
,
"java\\.util"
,
"\\s*
.*
\\s*\\[\\]\\s*.*\\s*=\\s*new
.*
\\[.*\\]\\s*;"
,
".*\\s*=\\s*new
.*
\\[.*\\]\\s*;"
);
Inspection
.
assertNoImportsOf
(
PROBLEM_2_SOURCE
,
regexps
);
Inspection
.
assertNoUsageOf
(
PROBLEM_2_SOURCE
,
regexps
);
}
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help