Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CS283
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Charles Barnwell
CS283
Commits
98d41d74
Commit
98d41d74
authored
2 months ago
by
cxb23
Browse files
Options
Downloads
Patches
Plain Diff
added to student_test.sh and passed tests. fully finished with coding assigmment
parent
7bec628c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
4-ShellP2/student_test.sh
+21
-5
21 additions, 5 deletions
4-ShellP2/student_test.sh
with
21 additions
and
5 deletions
4-ShellP2/student_test.sh
100644 → 100755
+
21
−
5
View file @
98d41d74
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
# Create your unit tests suit in this file
# Create your unit tests suit in this file
@test
"Example: check ls runs without errors"
{
@test
"Example: check ls runs without errors"
{
run ./dsh
<<
EOF
run
"
./dsh
"
<<
EOF
ls
ls
EOF
EOF
...
@@ -13,11 +13,27 @@ EOF
...
@@ -13,11 +13,27 @@ EOF
[
"
$status
"
-eq
0
]
[
"
$status
"
-eq
0
]
}
}
@test
"Change directory to bats"
{
@test
"Change directory, then remove directory"
{
run ./dsh
<<
EOF
run
"./dsh"
<<
EOF
cd bats
cd dsh-test
cd ..
rm dsh-test
EOF
EOF
[
"
$status
"
-eq
0
]
}
@test
"check echo runs without errors"
{
run
"./dsh"
<<
EOF
echo "helloooooo sailor"
EOF
# Strip all whitespace (spaces, tabs, newlines) from the output
stripped_output
=
$(
echo
"
$output
"
|
tr
-d
'\t\n\r\f\v'
)
# Expected output with all whitespace removed for easier matching
expected_output
=
"helloooooo sailordsh2> dsh2> cmd loop returned 0"
[
"
$stripped_output
"
=
"
$expected_output
"
]
[
"
$stripped_output
"
=
"
$expected_output
"
]
[
"
$status
"
-eq
0]
[
"
$status
"
-eq
0
]
}
}
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