From 3de1c3fff07f230d1c4ab62471cbb6eb0cced3e5 Mon Sep 17 00:00:00 2001 From: Nikita Danilenko Date: Mon, 29 Aug 2022 22:28:59 +0200 Subject: [PATCH] #193: Adjust test expectations --- src/test/scala/bridges/elm/ElmFileBuilderSpec.scala | 6 +++--- src/test/scala/bridges/elm/ElmJsonEncoderSpec.scala | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/test/scala/bridges/elm/ElmFileBuilderSpec.scala b/src/test/scala/bridges/elm/ElmFileBuilderSpec.scala index 2b2f3b3..60cd1dd 100644 --- a/src/test/scala/bridges/elm/ElmFileBuilderSpec.scala +++ b/src/test/scala/bridges/elm/ElmFileBuilderSpec.scala @@ -124,8 +124,8 @@ class ElmFileBuilderSpec extends AnyFreeSpec with Matchers { encoderNavigation : Navigation -> Encode.Value encoderNavigation tpe = case tpe of - Node name children -> Encode.object [ ("name", Encode.string name), ("children", Encode.list (List.map encoderNavigation children)), ("type", Encode.string "Node") ] - NodeList all -> Encode.object [ ("all", Encode.list (List.map encoderNavigation all)), ("type", Encode.string "NodeList") ] + Node name children -> Encode.object [ ("name", Encode.string name), ("children", Encode.list encoderNavigation children), ("type", Encode.string "Node") ] + NodeList all -> Encode.object [ ("all", Encode.list encoderNavigation all), ("type", Encode.string "NodeList") ] """ val expected = ("Navigation.elm", fileContent) @@ -333,7 +333,7 @@ class ElmFileBuilderSpec extends AnyFreeSpec with Matchers { encoderTypeOne : TypeOne -> Encode.Value - encoderTypeOne obj = Encode.object [ ("name", Encode.string obj.name), ("values", Encode.list (List.map encoderTypeTwo obj.values)) ] + encoderTypeOne obj = Encode.object [ ("name", Encode.string obj.name), ("values", Encode.list encoderTypeTwo obj.values) ] encoderTypeTwo : TypeTwo -> Encode.Value encoderTypeTwo tpe = diff --git a/src/test/scala/bridges/elm/ElmJsonEncoderSpec.scala b/src/test/scala/bridges/elm/ElmJsonEncoderSpec.scala index ffc3d13..5ab499c 100644 --- a/src/test/scala/bridges/elm/ElmJsonEncoderSpec.scala +++ b/src/test/scala/bridges/elm/ElmJsonEncoderSpec.scala @@ -63,7 +63,7 @@ class ElmJsonEncoderSpec extends AnyFreeSpec with Matchers { Elm.encoder(decl[ArrayClass]) shouldBe { i""" encoderArrayClass : ArrayClass -> Encode.Value - encoderArrayClass obj = Encode.object [ ("aList", Encode.list (List.map Encode.string obj.aList)), ("optField", Maybe.withDefault Encode.null (Maybe.map Encode.float obj.optField)) ] + encoderArrayClass obj = Encode.object [ ("aList", Encode.list Encode.string obj.aList), ("optField", Maybe.withDefault Encode.null (Maybe.map Encode.float obj.optField)) ] """ } } @@ -94,8 +94,8 @@ class ElmJsonEncoderSpec extends AnyFreeSpec with Matchers { encoderNavigation : Navigation -> Encode.Value encoderNavigation tpe = case tpe of - Node name children -> Encode.object [ ("name", Encode.string name), ("children", Encode.list (List.map encoderNavigation children)), ("type", Encode.string "Node") ] - NodeList all -> Encode.object [ ("all", Encode.list (List.map encoderNavigation all)), ("type", Encode.string "NodeList") ] + Node name children -> Encode.object [ ("name", Encode.string name), ("children", Encode.list encoderNavigation children), ("type", Encode.string "Node") ] + NodeList all -> Encode.object [ ("all", Encode.list encoderNavigation all), ("type", Encode.string "NodeList") ] """ } } @@ -113,7 +113,7 @@ class ElmJsonEncoderSpec extends AnyFreeSpec with Matchers { Elm.encoder(List(decl[TypeOne], decl[TypeTwo]), Map.empty[Ref, TypeReplacement]) shouldBe { i""" encoderTypeOne : TypeOne -> Encode.Value - encoderTypeOne obj = Encode.object [ ("name", Encode.string obj.name), ("values", Encode.list (List.map encoderTypeTwo obj.values)) ] + encoderTypeOne obj = Encode.object [ ("name", Encode.string obj.name), ("values", Encode.list encoderTypeTwo obj.values) ] encoderTypeTwo : TypeTwo -> Encode.Value encoderTypeTwo tpe = @@ -217,7 +217,7 @@ class ElmJsonEncoderSpec extends AnyFreeSpec with Matchers { Elm.encoder(decl[Recursive2]) shouldBe { i""" encoderRecursive2 : Recursive2 -> Encode.Value - encoderRecursive2 obj = Encode.object [ ("head", Encode.int obj.head), ("tail", Encode.list (List.map encoderRecursive2 obj.tail)) ] + encoderRecursive2 obj = Encode.object [ ("head", Encode.int obj.head), ("tail", Encode.list encoderRecursive2 obj.tail) ] """ } }