Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SustainableSoftwareEngineering.jl
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
Service Desk
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
Theisen, Lambert
SustainableSoftwareEngineering.jl
Commits
54e23922
Commit
54e23922
authored
1 year ago
by
Theisen, Lambert
Browse files
Options
Downloads
Patches
Plain Diff
Fix testing
parent
a9f5e452
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#1989
passed
1 year ago
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/src/lecture/4-julia_testing.md
+24
-1
24 additions, 1 deletion
docs/src/lecture/4-julia_testing.md
with
24 additions
and
1 deletion
docs/src/lecture/4-julia_testing.md
+
24
−
1
View file @
54e23922
...
...
@@ -35,7 +35,7 @@ Create a file named `test_add.jl`:
```
julia
using
Test
include
(
"add.jl"
)
# Include the file containing the `add` function, or load package
using
SustainableSoftwareEngineering
@testset
"Addition Tests"
begin
@test
add
(
2
,
2
)
==
4
...
...
@@ -70,6 +70,29 @@ This command will execute all tests defined in your project's `test` directory.
#### An example output
The above testing file would yield a successful output:
```
julia
julia
>
include
(
"test/runtests.jl"
)
# Test Summary: | Pass Total Time
# Addition Tests | 4 4 0.0s
```
However, changing the above test file to:
```
julia
using
Test
using
SustainableSoftwareEngineering
@testset
"Addition Tests"
begin
@test
add
(
2
,
2
)
==
4
@test
add
(
-
1
,
1
)
==
0
@test
add
(
0
,
0
)
==
1
# changed 🚨
@test_throws
DomainError
add
(
"a"
,
"b"
)
end
```
would result in an error:
```
julia
# Addition Tests: Test Failed at XXX/gits/nmh/SustainableSoftwareEngineering.jl/test/test_add.jl:7
# Expression: add(0, 0) == 1
...
...
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