Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
short-exercises
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
Tilman Voit
short-exercises
Commits
262dbf67
Commit
262dbf67
authored
5 years ago
by
Alexander Gehrke
Browse files
Options
Downloads
Patches
Plain Diff
[lec06] Add tests
parent
c785a212
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/test/scala/typeclasses/FunctorSpec.scala
+11
-0
11 additions, 0 deletions
src/test/scala/typeclasses/FunctorSpec.scala
src/test/scala/typeclasses/ShowSpec.scala
+16
-0
16 additions, 0 deletions
src/test/scala/typeclasses/ShowSpec.scala
with
27 additions
and
0 deletions
src/test/scala/typeclasses/FunctorSpec.scala
0 → 100644
+
11
−
0
View file @
262dbf67
package
typeclasses
import
org.scalatest._
import
testutil.PendingIfUnimplemented
@SuppressWarnings
(
Array
(
"org.wartremover.warts.All"
))
class
FunctorSpec
extends
FlatSpec
with
Matchers
with
AppendedClues
with
PendingIfUnimplemented
{
"The Functor instance for Option"
should
"be available in implicit scope"
in
{
"implicitly[Functor[Option]]"
should
compile
}
}
This diff is collapsed.
Click to expand it.
src/test/scala/typeclasses/ShowSpec.scala
0 → 100644
+
16
−
0
View file @
262dbf67
package
typeclasses
import
org.scalatest._
import
testutil.PendingIfUnimplemented
@SuppressWarnings
(
Array
(
"org.wartremover.warts.All"
))
class
ShowSpec
extends
FlatSpec
with
Matchers
with
AppendedClues
with
PendingIfUnimplemented
{
"The Show instance for Person"
should
"be available in implicit scope"
in
{
"implicitly[Show[Person]]"
should
compile
}
it
should
"display in format\"[firstName] [lastName] is [age] years old\""
in
{
// uncomment as soon as you pass the above test
//implicitly[Show[Person]].show(People.odersky) shouldBe "Martin Odersky is 60 years old"
}
}
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