Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jurisk committed Dec 2, 2023
1 parent 7437452 commit 9cb2aad
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
1 change: 1 addition & 0 deletions scala2/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ lazy val root = (project in file("."))
Set(
ScalacOptions.warnValueDiscard,
ScalacOptions.warnUnusedPrivates,
ScalacOptions.warnUnusedLocals,
ScalacOptions.warnNumericWiden,
ScalacOptions.warnUnusedImports,
ScalacOptions.warnNonUnitStatement,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import jurisk.utils.Parsing.StringOps
import jurisk.utils.Utils.IterableOps
import org.scalatest.matchers.should.Matchers._

object AdventTemplate {
object Advent00 {
type Parsed = List[Command]

sealed trait Command
Expand All @@ -33,13 +33,12 @@ object AdventTemplate {
def part2(data: Parsed): Int =
data.length

def main(args: Array[String]): Unit = {
val testData = readFileText("2022/00-test.txt")
// val testData = """"""
val realData = readFileText("2022/00.txt")
def parseFile(fileName: String): Parsed =
parse(readFileText(fileName))

val test = parse(testData)
val real = parse(realData)
def main(args: Array[String]): Unit = {
val test = parseFile("2022/00-test.txt")
val real = parseFile("2022/00.txt")

part1(test) shouldEqual 12345678
part1(real) shouldEqual 12345678
Expand Down
23 changes: 23 additions & 0 deletions scala2/src/test/scala/jurisk/adventofcode/Advent00Spec.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package jurisk.adventofcode

import org.scalatest.flatspec.AnyFlatSpec
import Advent00._
import org.scalatest.matchers.should.Matchers._

class Advent00Spec extends AnyFlatSpec {
"Advent00" should "test part 1" ignore {
part1(parseFile("0000/00-test.txt")) shouldEqual 12345678
}

it should "test part 2" ignore {
part2(parseFile("0000/00-test.txt")) shouldEqual 12345678
}

it should "real part 1" ignore {
part1(parseFile("0000/00.txt")) shouldEqual 12345678
}

it should "real part 2" ignore {
part2(parseFile("0000/00.txt")) shouldEqual 12345678
}
}

0 comments on commit 9cb2aad

Please sign in to comment.