Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CS503
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
Vanshika Mohan Bongade
CS503
Commits
3ab7bf5d
Commit
3ab7bf5d
authored
2 months ago
by
Vanshika Mohan Bongade
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
c5c1ec09
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
WEEK-7/bats/assignment_tests.sh
+35
-0
35 additions, 0 deletions
WEEK-7/bats/assignment_tests.sh
with
35 additions
and
0 deletions
WEEK-7/bats/assignment_tests.sh
0 → 100644
+
35
−
0
View file @
3ab7bf5d
#!/usr/bin/env bats
############################ DO NOT EDIT THIS FILE #####################################
# File: assignment_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 spaces and newlines from the output
stripped_output
=
$(
echo
"
$output
"
|
tr
-d
'[:space:]'
)
# Adjusted expected output format
expected_output
=
"dshlib.c"
# Debugging output if test fails
echo
"Captured stdout:"
echo
"Output:
$output
"
echo
"Exit Status:
$status
"
echo
"
${
stripped_output
}
->
${
expected_output
}
"
# Check for expected output
[[
"
$stripped_output
"
==
*
"
$expected_output
"
*
]]
# 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