Skip to content

Commit

Permalink
test: add test samples
Browse files Browse the repository at this point in the history
Adds test samples that can be used for unit tests or to verify
implementations via:
```bash
for sample in $(ls src/test/resources/samples/*.txt)
do
  echo "Validating $sample"
  rm -f measurements.txt
  ln -s $sample measurements.txt

  diff <(./calculate_average.sh) ${sample%.txt}.out
done
rm measurements.txt
```

For #61
  • Loading branch information
AlexanderYastrebov committed Jan 4, 2024
1 parent 9a558e2 commit c9400bc
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ nb-configuration.xml
#JReleaser
out/

measurements*.txt
/measurements*.txt
1 change: 1 addition & 0 deletions src/test/resources/samples/measurements-1.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{Kunming=19.8/19.8/19.8}
1 change: 1 addition & 0 deletions src/test/resources/samples/measurements-1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Kunming;19.8
1 change: 1 addition & 0 deletions src/test/resources/samples/measurements-10.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{Adelaide=15.0/15.0/15.0, Cabo San Lucas=14.9/14.9/14.9, Dodoma=22.2/22.2/22.2, Halifax=12.9/12.9/12.9, Karachi=15.4/15.4/15.4, Pittsburgh=9.7/9.7/9.7, Ségou=25.7/25.7/25.7, Tauranga=38.2/38.2/38.2, Xi'an=24.2/24.2/24.2, Zagreb=12.2/12.2/12.2}
10 changes: 10 additions & 0 deletions src/test/resources/samples/measurements-10.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Halifax;12.9
Zagreb;12.2
Cabo San Lucas;14.9
Adelaide;15.0
Ségou;25.7
Pittsburgh;9.7
Karachi;15.4
Xi'an;24.2
Dodoma;22.2
Tauranga;38.2
1 change: 1 addition & 0 deletions src/test/resources/samples/measurements-2.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{Bosaso=19.2/19.2/19.2, Petropavlovsk-Kamchatsky=9.5/9.5/9.5}
2 changes: 2 additions & 0 deletions src/test/resources/samples/measurements-2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Bosaso;19.2
Petropavlovsk-Kamchatsky;9.5

0 comments on commit c9400bc

Please sign in to comment.