From 54e23922dd7b76bfec315920ddc32a6bfdb3551c Mon Sep 17 00:00:00 2001
From: Lambert Theisen <lambert.theisen@rwth-aachen.de>
Date: Tue, 21 Nov 2023 18:19:49 +0100
Subject: [PATCH] Fix testing

---
 docs/src/lecture/4-julia_testing.md | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/docs/src/lecture/4-julia_testing.md b/docs/src/lecture/4-julia_testing.md
index 6cedb22..34105cc 100644
--- a/docs/src/lecture/4-julia_testing.md
+++ b/docs/src/lecture/4-julia_testing.md
@@ -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
-- 
GitLab