<commit_before>package co.blocke.scalajack

import org.scalatest.Matchers._
import org.scalatest.{BeforeAndAfterAll, FunSpec, GivenWhenThen}

import scala.language.postfixOps

case class AwfulKey(f1: String, f2: Option[Int])

case class AwfulValue(f3: Double, f4: List[Boolean])

case class AwfulContainer(map: Map[AwfulKey, AwfulValue])

class AwfulKeys extends FunSpec with GivenWhenThen with BeforeAndAfterAll {
  val sjJS = ScalaJack()

  describe("Awful keys") {
    it("should deal with them") {
      val before = AwfulContainer(Map(
        AwfulKey("cat", Some(1)) -> AwfulValue(1.0, List(false, true)),
        AwfulKey("dog", Some(2)) -> AwfulValue(2.0, List(true))
      ))

      val json = sjJS.render(before)

      val after = sjJS.read[AwfulContainer](json)

      after should be(before)
    }
  }
}<commit_msg>Added expectation of JSON keys.<commit_after>package co.blocke.scalajack

import org.scalatest.Matchers._
import org.scalatest.{BeforeAndAfterAll, FunSpec, GivenWhenThen}

import scala.language.postfixOps

case class AwfulKey(f1: String, f2: Option[Int])

case class AwfulValue(f3: Double, f4: List[Boolean])

case class AwfulContainer(map: Map[AwfulKey, AwfulValue])

class AwfulKeys extends FunSpec with GivenWhenThen with BeforeAndAfterAll {
  val sjJS = ScalaJack()

  describe("Awful keys") {
    it("should deal with them") {
      val before = AwfulContainer(Map(
        AwfulKey("cat", Some(1)) -> AwfulValue(1.0, List(false, true)),
        AwfulKey("dog", Some(2)) -> AwfulValue(2.0, List(true))
      ))

      val json = sjJS.render(before)
      json should be ("""{"map":{"{\"f1\":\"cat\",\"f2\":1}":{"f3":1.0,"f4":[false,true]},"{\"f1\":\"dog\",\"f2\":2}":{"f3":2.0,"f4":[true]}}}""")

      val after = sjJS.read[AwfulContainer](json)

      after should be(before)
    }
  }
}
{'fraction_non_alphanumeric': 0.1568842567196928, 'fraction_numerical': 0.018650575973669776, 'mean_word_length': 4.1525423728813555, 'pattern_counts': {'":': 11, '<': 3, '<?xml version=': 0, '>': 7, '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': '7554671', 'n_tokens_mistral': 654, 'n_tokens_neox': 633, 'n_words': 138}