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
Joey Le
Cs283
Commits
c722dd44
Commit
c722dd44
authored
2 months ago
by
Joey Le
Browse files
Options
Downloads
Patches
Plain Diff
Moved two filed assignemnt_tests and student tests
parent
2f7d2da3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Assignment-06/starter/assignment_tests.sh
+36
-0
36 additions, 0 deletions
Assignment-06/starter/assignment_tests.sh
Assignment-06/starter/student_tests.sh
+14
-0
14 additions, 0 deletions
Assignment-06/starter/student_tests.sh
with
50 additions
and
0 deletions
Assignment-06/starter/assignment_tests.sh
0 → 100644
+
36
−
0
View file @
c722dd44
#!/usr/bin/env bats
############################ DO NOT EDIT THIS FILE #####################################
# File: assignement_tests.sh
#
# DO NOT EDIT THIS FILE
#
# Add/Edit Student tests in student_tests.sh
#
# All tests in this file must pass - it is used as part of grading!
########################################################################################
@test
"Pipes"
{
run
"./dsh"
<<
EOF
ls | grep dshlib.c
EOF
# Strip all whitespace (spaces, tabs, newlines) from the output
stripped_output
=
$(
echo
"
$output
"
|
tr
-d
'[:space:]'
)
# Expected output with all whitespace removed for easier matching
expected_output
=
"dshlib.clocalmodedsh4>dsh4>cmdloopreturned0"
# These echo commands will help with debugging and will only print
#if the test fails
echo
"Captured stdout:"
echo
"Output:
$output
"
echo
"Exit Status:
$status
"
echo
"
${
stripped_output
}
->
${
expected_output
}
"
# Check exact match
[
"
$stripped_output
"
=
"
$expected_output
"
]
# Assertions
[
"
$status
"
-eq
0
]
}
This diff is collapsed.
Click to expand it.
Assignment-06/starter/student_tests.sh
0 → 100644
+
14
−
0
View file @
c722dd44
#!/usr/bin/env bats
# File: student_tests.sh
#
# Create your unit tests suit in this file
@test
"Example: check ls runs without errors"
{
run ./dsh
<<
EOF
ls
EOF
# Assertions
[
"
$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