<commit_before>import brainflight.binary.{DataModel,DataStore,ModelStore}
import org.specs2.mutable.Specification
import java.io.FileNotFoundException
import brainflight.tools.geometry.NGonalFrustum
import play.api.test._
import play.api.test.Helpers._

class DataModelTestSpecs extends Specification {
  sequential
  object TestModel extends DataModel {
    val id = "testModel"
    val yLength = 2
    val polygons = new NGonalFrustum(4, yLength, yLength / 2, yLength / 2).polygons
  }

  "ModelStore" should {
    "contain one Element" in {
      ModelStore.models.clear()
      ModelStore.register(TestModel)
      ModelStore.models.size must be equalTo 1
    }
    "match Cube id" in {
      ModelStore.register(TestModel)
      ModelStore(TestModel.id) must beLike {
        case Some(_) => ok
        case _ => ko
      }
    }
  }

  "Abstract DataModel" should {
    "be able to move Model" in {
      TestModel.rotateAndMove((1, 2, 3), (0, 1, 0)).seq must be equalTo IndexedSeq(
        (0, 2, 2), (0, 2, 3), (0, 2, 4), (1, 2, 2), (1, 2, 3), (1, 2, 4), (2, 2, 2), (2, 2, 3), (2, 2, 4), (0, 3, 2), (0, 3, 3), (0, 3, 4), (1, 3, 2), (1, 3, 3), (1, 3, 4), (2, 3, 2), (2, 3, 3), (2, 3, 4), (0, 4, 2), (0, 4, 3), (0, 4, 4), (1, 4, 2), (1, 4, 3), (1, 4, 4), (2, 4, 2), (2, 4, 3), (2, 4, 4)
      )
    }
    "be able to rotate Model" in {
      TestModel.rotateAndMove((0, 0, 0), (1, 2, 3)).seq must be equalTo IndexedSeq(
        (-1, 1, 0), (-1, 0, 0), (-1, -1, 1), (0, 1, -1), (0, 0, 0), (0, -1, 1), (1, 1, -1), (1, 0, 0), (1, -1, 0), (-1, 2, 0), (-1, 1, 1), (-1, 0, 2), (0, 1, 0), (0, 1, 1), (0, 0, 1), (1, 1, 0), (1, 0, 1), (1, -1, 1), (0, 2, 1), (0, 1, 2), (-1, 1, 2), (1, 2, 1), (1, 1, 2), (0, 0, 2), (2, 2, 1), (1, 1, 1), (1, 0, 2)
      )
    }
    "should rotate independent of the rotating vectors size" in {
      TestModel.rotateAndMove((0, 0, 0), (1, 2, 3)) must be equalTo TestModel.rotateAndMove((0, 0, 0), (2, 4, 6))
    }
  }
}<commit_msg>fixed failed tests<commit_after>import brainflight.binary.{DataModel,DataStore,ModelStore}
import org.specs2.mutable.Specification
import java.io.FileNotFoundException
import brainflight.tools.geometry.NGonalFrustum
import play.api.test._
import play.api.test.Helpers._

class DataModelTestSpecs extends Specification {
  sequential
  object TestModel extends DataModel {
    val id = "testModel"
    val yLength = 2
    val polygons = new NGonalFrustum(4, yLength, yLength / 2, yLength / 2).polygons
  }

  "ModelStore" should {
    "contain one Element" in {
      ModelStore.models.clear()
      ModelStore.register(TestModel)
      ModelStore.models.size must be equalTo 1
    }
    "match Cube id" in {
      ModelStore.register(TestModel)
      ModelStore(TestModel.id) must beLike {
        case Some(_) => ok
        case _ => ko
      }
    }
  }

  "Abstract DataModel" should {
    "be able to move Model" in {
      TestModel.rotateAndMove((1, 2, 3), (0, 1, 0)).seq must be equalTo IndexedSeq(
        (0,1,3), (0,1,4), (0,1,5), (1,1,3), (1,1,4), (1,1,5), (2,1,3), (2,1,4), (2,1,5), (0,2,3), (0,2,4), (0,2,5), (1,2,3), (1,2,4), (1,2,5), (2,2,3), (2,2,4), (2,2,5), (0,3,3), (0,3,4), (0,3,5), (1,3,3), (1,3,4), (1,3,5), (2,3,3), (2,3,4), (2,3,5)
      )
    }
    "contain points in the correct order" in {
      TestModel.containingCoordinates must be equalTo IndexedSeq((-1,-1,0), (-1,-1,1), (-1,-1,2), (0,-1,0), (0,-1,1), (0,-1,2), (1,-1,0), (1,-1,1), (1,-1,2), (-1,0,0), (-1,0,1), (-1,0,2), (0,0,0), (0,0,1), (0,0,2), (1,0,0), (1,0,1), (1,0,2), (-1,1,0), (-1,1,1), (-1,1,2), (0,1,0), (0,1,1), (0,1,2), (1,1,0), (1,1,1), (1,1,2))
    }
    "be able to rotate Model" in {
      TestModel.rotateAndMove((0, 0, 0), (1, 2, 3)).seq must be equalTo IndexedSeq(
        (-1,0,-1), (-1,-1,0), (-1,-2,1), (0,-1,-1), (0,-1,0), (-1,-2,0), (1,-1,-1), (1,-2,0), (0,-2,0), (-1,0,0), (-1,-1,1), (-1,-1,1), (0,0,0), (0,-1,1), (0,-2,1), (1,0,0), (1,-1,0), (1,-2,1), (-1,1,1), (-1,0,2), (-1,-1,2), (0,1,1), (0,0,1), (0,-1,2), (1,0,1), (1,-1,1), (1,-1,2)
      )
    }
    "rotate independent of the rotating vectors size" in {
      TestModel.rotateAndMove((0, 0, 0), (1, 2, 3)) must be equalTo TestModel.rotateAndMove((0, 0, 0), (2, 4, 6))
    }
  }
}
{'fraction_non_alphanumeric': 0.24506774423579747, 'fraction_numerical': 0.11053006893273117, 'mean_word_length': 3.0657004830917876, 'pattern_counts': {'":': 0, '<': 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': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5984677', 'n_tokens_mistral': 2023, 'n_tokens_neox': 1865, 'n_words': 497}