<commit_before>module Css.Internal.PropertyTests where

import Spec exposing (..)
import Css.TestUtils exposing (it)

import Css.Internal.Property exposing (..)

-------------------------------------------------------------------------------

suite : Spec
suite = describe "Css.PropertyTests"
  [ stringValueFactoryTest, commaListValueFactoryTest ]

stringValueFactoryTest : Spec
stringValueFactoryTest =
  describe "stringValueFactory"
    [ stringValue "a" `shouldEqual` Value (Plain "a")
    ]

commaListValueFactoryTest : Spec
commaListValueFactoryTest =
  describe "pairValueFactory"
    [ it "should wrap an empty list"
        [ commaListValue stringValue [] `shouldEqual` emptyValue ]
    , it "should wrap plain values"
        [ commaListValue stringValue ["a", "b"] `shouldEqual` Value (Plain "a,b")]
    ]

-- TODO Test wrappers involving prefixed values in order to test merge instead of test below
{-<commit_msg>Fix test that didn't get included in last commit.<commit_after>module Css.Internal.PropertyTests where

import Spec exposing (..)
import Css.TestUtils exposing (it)

import Css.Internal.Stylesheet exposing (simpleProperty)
import Css exposing (renderProperties)

import Css.Internal.Property exposing (..)
-------------------------------------------------------------------------------

suite : Spec
suite = describe "Css.PropertyTests"
  [ stringValueFactoryTest, commaListValueFactoryTest ]

stringValueFactoryTest : Spec
stringValueFactoryTest =
  describe "stringValueFactory"
    [ renderProperties [simpleProperty "key" (stringValue "a") ]
        `shouldEqual` "key:a" ]

commaListValueFactoryTest : Spec
commaListValueFactoryTest =
  describe "pairValueFactory"
    [ it "should wrap an empty list"
      [ renderProperties [ commaListValue stringValue [] |> simpleProperty "key" ]
         `shouldEqual` "key:" 
      ]
    , it "should wrap plain values"
        [ renderProperties 
              [ commaListValue stringValue ["a", "b"]  |> simpleProperty "key" ]
            `shouldEqual` "key:a,b" 
        ]
    ]

-- TODO Test wrappers involving prefixed values in order to test merge instead of test below
{-
{'fraction_non_alphanumeric': 0.15774778966961378, 'fraction_numerical': 0.0, 'mean_word_length': 2.8392857142857144, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4210776', 'n_tokens_mistral': 574, 'n_tokens_neox': 555, 'n_words': 169}