Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AdvProg-Exercises
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor 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
kiady.arintsoa
AdvProg-Exercises
Commits
96976a71
Commit
96976a71
authored
2 years ago
by
kiady.arintsoa
Browse files
Options
Downloads
Patches
Plain Diff
Migrate from FunSuite to WordSpec for ex1
parent
fc24fd50
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
test-src/Ex1Spec.scala
+28
-0
28 additions, 0 deletions
test-src/Ex1Spec.scala
test-src/Ex1Suite.scala
+0
-21
0 additions, 21 deletions
test-src/Ex1Suite.scala
with
28 additions
and
21 deletions
test-src/Ex1Spec.scala
0 → 100644
+
28
−
0
View file @
96976a71
package
ex1
import
org.scalatest.matchers.should.Matchers
import
org.scalatest.wordspec.AnyWordSpec
class
Ex1Spec
extends
AnyWordSpec
with
Matchers
{
"The first function"
must
{
"create a list of numbers which are consecutive multiples of 3"
in
{
One
()
should
be
(
List
(
3
,
6
,
9
,
12
,
15
,
18
,
21
,
24
,
27
,
30
,
33
,
36
,
39
,
42
,
45
,
48
,
51
,
54
,
57
,
60
,
63
,
66
,
69
,
72
,
75
,
78
,
81
))
}
}
"The second function"
must
{
"generate a new list where each element is tripled"
in
{
Two
(
List
(
3
,
5
,
2
,
3
,
9
,
4
,
2
))
should
be
(
List
(
9
,
15
,
6
,
9
,
27
,
12
,
6
))
}
}
"The third function"
must
{
"keep only elements with decimal part > 0.5"
in
{
Three
(
List
(
45.6
,
23.1
,
22.7
,
32.2
))
should
be
(
List
(
45.6
,
22.7
))
}
}
"The fourth function"
must
{
"map to (capitalized, length) then filter start with 'L' and finally show biggest"
in
{
Four
(
List
(
"jim"
,
"lara"
,
"linda"
,
"john"
,
"barry"
))
should
be
(
5
)
}
}
}
This diff is collapsed.
Click to expand it.
test-src/Ex1Suite.scala
deleted
100644 → 0
+
0
−
21
View file @
fc24fd50
package
ex1
import
org.scalatest.funsuite.AnyFunSuite
class
Ex1Suite
extends
AnyFunSuite
{
test
(
"1. Create a list of numbers which are consecutive multiples of 3"
)
{
assert
(
One
()
==
List
(
3
,
6
,
9
,
12
,
15
,
18
,
21
,
24
,
27
,
30
,
33
,
36
,
39
,
42
,
45
,
48
,
51
,
54
,
57
,
60
,
63
,
66
,
69
,
72
,
75
,
78
,
81
)
)
}
test
(
"2. Generate a new list where each element is tripled"
)
{
assert
(
Two
(
List
(
3
,
5
,
2
,
3
,
9
,
4
,
2
))
==
List
(
9
,
15
,
6
,
9
,
27
,
12
,
6
))
}
test
(
"3. Keep only elements with decimal > 0.5"
)
{
assert
(
Three
(
List
(
45.6
,
23.1
,
22.7
,
32.2
))
==
List
(
45.6
,
22.7
))
}
test
(
"4. To map (capitalized, length), filter start with L, show biggest"
)
{
assert
(
Four
(
List
(
"jim"
,
"lara"
,
"linda"
,
"john"
,
"barry"
))
==
5
)
}
}
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