Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lab3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
snorre.bue
lab3
Commits
bbdfccaf
Commit
bbdfccaf
authored
1 year ago
by
Villsty
Browse files
Options
Downloads
Patches
Plain Diff
removed a thing, thanks Torstein
parent
ee555121
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/no/uib/inf101/terminal/SimpleShell.java
+1
-5
1 addition, 5 deletions
src/main/java/no/uib/inf101/terminal/SimpleShell.java
src/test/java/no/uib/inf101/terminal/TestSimpleShellStarter.java
+6
-6
6 additions, 6 deletions
...t/java/no/uib/inf101/terminal/TestSimpleShellStarter.java
with
7 additions
and
11 deletions
src/main/java/no/uib/inf101/terminal/SimpleShell.java
+
1
−
5
View file @
bbdfccaf
...
...
@@ -75,7 +75,7 @@ public class SimpleShell implements CommandLineInterface {
*/
@Override
public
String
s
creen
Looks
()
{
public
String
getS
creen
Content
()
{
String
s
=
""
;
for
(
String
line
:
this
.
history
)
{
s
+=
line
;
...
...
@@ -169,9 +169,5 @@ public class SimpleShell implements CommandLineInterface {
return
s
;
}
@Override
public
void
keyPressed
(
char
key
)
{
}
}
This diff is collapsed.
Click to expand it.
src/test/java/no/uib/inf101/terminal/TestSimpleShellStarter.java
+
6
−
6
View file @
bbdfccaf
...
...
@@ -23,7 +23,7 @@ public class TestSimpleShellStarter {
@Test
public
void
testDoNothing
()
{
assertEquals
(
"$ "
,
shell
.
s
creen
Looks
());
assertEquals
(
"$ "
,
shell
.
getS
creen
Content
());
}
@Test
...
...
@@ -32,7 +32,7 @@ public class TestSimpleShellStarter {
shell
.
KeyPressed
(
'o'
);
shell
.
KeyPressed
(
'o'
);
assertEquals
(
"$ foo"
,
shell
.
s
creen
Looks
());
assertEquals
(
"$ foo"
,
shell
.
getS
creen
Content
());
}
@Test
...
...
@@ -42,7 +42,7 @@ public class TestSimpleShellStarter {
shell
.
KeyPressed
(
'o'
);
shell
.
KeyPressed
(
'\n'
);
assertEquals
(
"$ foo\nCommand not found: \"foo\"\n$ "
,
shell
.
s
creen
Looks
());
assertEquals
(
"$ foo\nCommand not found: \"foo\"\n$ "
,
shell
.
getS
creen
Content
());
}
@Test
...
...
@@ -53,7 +53,7 @@ public class TestSimpleShellStarter {
shell
.
KeyPressed
(
'\n'
);
String
expected
=
"$ pwd"
+
"\n"
+
this
.
dir
.
getCanonicalPath
()
+
"\n$ "
;
assertEquals
(
expected
,
shell
.
s
creen
Looks
());
assertEquals
(
expected
,
shell
.
getS
creen
Content
());
}
@Test
...
...
@@ -63,7 +63,7 @@ public class TestSimpleShellStarter {
shell
.
KeyPressed
(
'\n'
);
String
expected
=
"$ ls\n"
+
SUBDIR
+
" \n$ "
;
assertEquals
(
expected
,
shell
.
s
creen
Looks
());
assertEquals
(
expected
,
shell
.
getS
creen
Content
());
}
@Test
...
...
@@ -97,7 +97,7 @@ public class TestSimpleShellStarter {
+
this
.
subdir
.
getCanonicalPath
()
+
"\n"
+
"$ "
;
assertEquals
(
expected
,
shell
.
s
creen
Looks
());
assertEquals
(
expected
,
shell
.
getS
creen
Content
());
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment