Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Nov 29, 2022
1 parent 2690bae commit 37b53b8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 1 addition & 2 deletions modules/common/src/main/Json.scala
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ object Json:
JsString(c.name)
}

given Format[FEN] = stringIsoFormat[FEN]
given Format[Markdown] = stringIsoFormat[Markdown]
given Format[FEN] = stringIsoFormat[FEN]

given Reads[Uci] = Reads.of[String] flatMapResult { str =>
JsResult.fromTry(Uci(str) toTry s"Invalid UCI: $str")
Expand Down
2 changes: 1 addition & 1 deletion modules/common/src/test/LameNameTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.specs2.mutable.*

class LameNameTest extends Specification {

def test = LameName.username _
def test(str: String) = LameName.username(UserName(str))

"disallow" >> {
"separated titles" >> {
Expand Down
2 changes: 2 additions & 0 deletions modules/user/src/test/AuthTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import scala.concurrent.ExecutionContext.Implicits.global

class AuthTest extends Specification {

given Conversion[String, UserId] = UserId(_)

val secret = Secret(Array.fill(32)(1.toByte).toBase64)
final def getAuth(passHasher: PasswordHasher) =
new Authenticator(
Expand Down
5 changes: 4 additions & 1 deletion modules/user/src/test/UserTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import org.specs2.mutable.Specification

class UserTest extends Specification {

def canSignup(str: UserId) =
given Conversion[String, UserStr] = UserStr(_)
given Conversion[String, UserId] = UserId(_)

def canSignup(str: String) =
User.newUsernamePrefix.pattern.matcher(str).matches && User.newUsernameSuffix.pattern
.matcher(str)
.matches &&
Expand Down

0 comments on commit 37b53b8

Please sign in to comment.