wasp/waspc/test/AI/GenerateNewProject/LogMsgTest.hs
Martin Šošić 994a58f0dc
Wasp ai cli mage (#1601)
* Improved Wasp AI CLI experience.

* fix

* Added CLI Usage, polished CLI commands.

* Added choice of temperature.

* Added styling.

* Added more sophisticated, terminal-only styling.

* fix

* Updated Mage to use new Wasp CLI + added some messaging to CLI.

* fix

* Created wasp-ai/README, updated waspc/README.

* Moved wasp-ai/ to mage/.

* Final polishing (docs, readmes, messaging).

* fix

* Added tests for LogMsg.

* Updated versions of test apps to 0.12.

* fix

* fix

* Update mage/README.md

* fix

* fix
2023-12-22 15:14:38 +01:00

22 lines
871 B
Haskell

module AI.GenerateNewProject.LogMsgTest where
import Test.Tasty.Hspec
import Wasp.AI.GenerateNewProject.LogMsg
import qualified Wasp.Util.Terminal as Term
spec_Wasp_AI_GenerateNewProject_LogMsg :: Spec
spec_Wasp_AI_GenerateNewProject_LogMsg = do
it "Concatenation" $ do
toPlainString ("foo" <> "bar") `shouldBe` toPlainString "foobar"
toPlainString ("foo" <> "bar") <> "buzz" `shouldBe` toPlainString "foobarbuzz"
toPlainString "foo " <> (" bar" <> " buzz") `shouldBe` toPlainString "foo bar buzz"
it "Styling" $ do
let styledMsg = styled Important "foo" <> " bar" <> styled Error "buzz"
toPlainString styledMsg `shouldBe` "foo barbuzz"
toTermString styledMsg
`shouldBe` ( Term.applyStyles [Term.Bold, Term.Magenta] "foo"
<> " bar"
<> Term.applyStyles [Term.Red] "buzz"
)