Skip to content

Commit

Permalink
Remove fuzz test case that I was debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
ysthakur committed Dec 16, 2024
1 parent 3a3f5b9 commit 56eee0f
Showing 1 changed file with 2 additions and 269 deletions.
271 changes: 2 additions & 269 deletions src/test/scala/fred/FuzzTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,275 +62,9 @@ class FuzzTests
}
}

val gen = GeneratedProgram(
List(
TypeDef(
Spanned("OptT0", Span.synth),
List(
EnumCase(
Spanned("SomeT0", Span.synth),
List(FieldDef(false, Spanned("value", Span.synth), TypeRef("T0", Span.synth), Span.synth)),
Span.synth
),
EnumCase(Spanned("NoneT0", Span.synth), List(), Span.synth)
),
Span.synth
),
TypeDef(
Spanned("OptT1", Span.synth),
List(
EnumCase(
Spanned("SomeT1", Span.synth),
List(FieldDef(false, Spanned("value", Span.synth), TypeRef("T1", Span.synth), Span.synth)),
Span.synth
),
EnumCase(Spanned("NoneT1", Span.synth), List(), Span.synth)
),
Span.synth
),
TypeDef(
Spanned("OptT2", Span.synth),
List(
EnumCase(
Spanned("SomeT2", Span.synth),
List(FieldDef(false, Spanned("value", Span.synth), TypeRef("T2", Span.synth), Span.synth)),
Span.synth
),
EnumCase(Spanned("NoneT2", Span.synth), List(), Span.synth)
),
Span.synth
),
TypeDef(
Spanned("T2", Span.synth),
List(EnumCase(
Spanned("T2", Span.synth),
List(
FieldDef(false, Spanned("f3", Span.synth), TypeRef("T1", Span.synth), Span.synth),
FieldDef(true, Spanned("f1", Span.synth), TypeRef("OptT2", Span.synth), Span.synth),
FieldDef(true, Spanned("f6", Span.synth), TypeRef("OptT2", Span.synth), Span.synth),
FieldDef(true, Spanned("f10", Span.synth), TypeRef("OptT2", Span.synth), Span.synth),
FieldDef(true, Spanned("f4", Span.synth), TypeRef("OptT0", Span.synth), Span.synth),
FieldDef(true, Spanned("f2", Span.synth), TypeRef("OptT2", Span.synth), Span.synth),
FieldDef(false, Spanned("f0", Span.synth), TypeRef("T1", Span.synth), Span.synth),
FieldDef(true, Spanned("f11", Span.synth), TypeRef("OptT2", Span.synth), Span.synth),
FieldDef(true, Spanned("f7", Span.synth), TypeRef("OptT0", Span.synth), Span.synth),
FieldDef(true, Spanned("f8", Span.synth), TypeRef("OptT0", Span.synth), Span.synth),
FieldDef(true, Spanned("f9", Span.synth), TypeRef("OptT2", Span.synth), Span.synth),
FieldDef(true, Spanned("f5", Span.synth), TypeRef("OptT2", Span.synth), Span.synth)
),
Span.synth
)),
Span.synth
),
TypeDef(
Spanned("T0", Span.synth),
List(EnumCase(
Spanned("T0", Span.synth),
List(
FieldDef(true, Spanned("f0", Span.synth), TypeRef("OptT0", Span.synth), Span.synth),
FieldDef(true, Spanned("f1", Span.synth), TypeRef("OptT2", Span.synth), Span.synth)
),
Span.synth
)),
Span.synth
),
TypeDef(
Spanned("T1", Span.synth),
List(EnumCase(
Spanned("T1", Span.synth),
List(FieldDef(true, Spanned("f0", Span.synth), TypeRef("OptT1", Span.synth), Span.synth)),
Span.synth
)),
Span.synth
)
),
Map(
"vT2_1" -> "T2",
"vT1_1" -> "T1",
"vT0_3" -> "T0",
"vT0_0" -> "T0",
"vT0_1" -> "T0",
"vT1_3" -> "T1",
"vT2_0" -> "T2",
"vT0_2" -> "T0",
"vT2_2" -> "T2",
"vT1_0" -> "T1",
"vT1_2" -> "T1",
"vT2_3" -> "T2"
),
List(
(
"vT0_3",
CtorCall(
Spanned("T0", Span.synth),
List(
(Spanned("f0", Span.synth), CtorCall(Spanned("NoneT0", Span.synth), List(), Span.synth)),
(Spanned("f1", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth))
),
Span.synth
)
),
(
"vT2_1",
CtorCall(
Spanned("T2", Span.synth),
List(
(Spanned("f3", Span.synth), VarRef("vT1_2", Span.synth)),
(Spanned("f1", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f6", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f10", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f4", Span.synth), CtorCall(Spanned("NoneT0", Span.synth), List(), Span.synth)),
(Spanned("f2", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f0", Span.synth), VarRef("vT1_2", Span.synth)),
(Spanned("f11", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f7", Span.synth), CtorCall(Spanned("NoneT0", Span.synth), List(), Span.synth)),
(Spanned("f8", Span.synth), CtorCall(Spanned("NoneT0", Span.synth), List(), Span.synth)),
(Spanned("f9", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f5", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth))
),
Span.synth
)
),
(
"vT0_1",
CtorCall(
Spanned("T0", Span.synth),
List(
(Spanned("f0", Span.synth), CtorCall(Spanned("NoneT0", Span.synth), List(), Span.synth)),
(Spanned("f1", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth))
),
Span.synth
)
),
(
"vT2_3",
CtorCall(
Spanned("T2", Span.synth),
List(
(Spanned("f3", Span.synth), VarRef("vT1_0", Span.synth)),
(Spanned("f1", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f6", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f10", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f4", Span.synth), CtorCall(Spanned("NoneT0", Span.synth), List(), Span.synth)),
(Spanned("f2", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f0", Span.synth), VarRef("vT1_1", Span.synth)),
(Spanned("f11", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f7", Span.synth), CtorCall(Spanned("NoneT0", Span.synth), List(), Span.synth)),
(Spanned("f8", Span.synth), CtorCall(Spanned("NoneT0", Span.synth), List(), Span.synth)),
(Spanned("f9", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f5", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth))
),
Span.synth
)
),
(
"vT2_0",
CtorCall(
Spanned("T2", Span.synth),
List(
(Spanned("f3", Span.synth), VarRef("vT1_3", Span.synth)),
(Spanned("f1", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f6", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f10", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f4", Span.synth), CtorCall(Spanned("NoneT0", Span.synth), List(), Span.synth)),
(Spanned("f2", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f0", Span.synth), VarRef("vT1_2", Span.synth)),
(Spanned("f11", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f7", Span.synth), CtorCall(Spanned("NoneT0", Span.synth), List(), Span.synth)),
(Spanned("f8", Span.synth), CtorCall(Spanned("NoneT0", Span.synth), List(), Span.synth)),
(Spanned("f9", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f5", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth))
),
Span.synth
)
),
(
"vT2_2",
CtorCall(
Spanned("T2", Span.synth),
List(
(Spanned("f3", Span.synth), VarRef("vT1_2", Span.synth)),
(Spanned("f1", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f6", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f10", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f4", Span.synth), CtorCall(Spanned("NoneT0", Span.synth), List(), Span.synth)),
(Spanned("f2", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f0", Span.synth), VarRef("vT1_1", Span.synth)),
(Spanned("f11", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f7", Span.synth), CtorCall(Spanned("NoneT0", Span.synth), List(), Span.synth)),
(Spanned("f8", Span.synth), CtorCall(Spanned("NoneT0", Span.synth), List(), Span.synth)),
(Spanned("f9", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth)),
(Spanned("f5", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth))
),
Span.synth
)
),
(
"vT0_0",
CtorCall(
Spanned("T0", Span.synth),
List(
(Spanned("f0", Span.synth), CtorCall(Spanned("NoneT0", Span.synth), List(), Span.synth)),
(Spanned("f1", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth))
),
Span.synth
)
),
(
"vT0_2",
CtorCall(
Spanned("T0", Span.synth),
List(
(Spanned("f0", Span.synth), CtorCall(Spanned("NoneT0", Span.synth), List(), Span.synth)),
(Spanned("f1", Span.synth), CtorCall(Spanned("NoneT2", Span.synth), List(), Span.synth))
),
Span.synth
)
),
(
"vT1_0",
CtorCall(
Spanned("T1", Span.synth),
List((Spanned("f0", Span.synth), CtorCall(Spanned("NoneT1", Span.synth), List(), Span.synth))),
Span.synth
)
),
(
"vT1_1",
CtorCall(
Spanned("T1", Span.synth),
List((Spanned("f0", Span.synth), CtorCall(Spanned("NoneT1", Span.synth), List(), Span.synth))),
Span.synth
)
),
(
"vT1_2",
CtorCall(
Spanned("T1", Span.synth),
List((Spanned("f0", Span.synth), CtorCall(Spanned("NoneT1", Span.synth), List(), Span.synth))),
Span.synth
)
),
(
"vT1_3",
CtorCall(
Spanned("T1", Span.synth),
List((Spanned("f0", Span.synth), CtorCall(Spanned("NoneT1", Span.synth), List(), Span.synth))),
Span.synth
)
)
),
List(
GenStmt.Assign("vT0_3", "f0", "T0", "vT0_1"),
GenStmt.Assign("vT0_1", "f0", "T0", "vT0_1"),
GenStmt.ValgrindCheck,
GenStmt.Assign("vT0_0", "f0", "T0", "vT0_3")
)
)

property("With intermediate checks", Slow) {
given PropertyCheckConfiguration =
PropertyCheckConfiguration(minSize = 5, sizeRange = 40)
PropertyCheckConfiguration(minSize = 5, sizeRange = 60)
given Shrink[GeneratedProgram] = GenUtil.shrinkGenerated

// TODO maybe randomness isn't needed here, just insert one check every few statements or something
Expand Down Expand Up @@ -367,8 +101,7 @@ class FuzzTests
)
}

//forAll(genFull.apply(Parameters.default, Seed(6529581269390504088L)).get) {
forAll(Gen.const(gen)) {
forAll(genFull) {
generated =>
ExecTests.valgrindCheck(
generated.asAst,
Expand Down

0 comments on commit 56eee0f

Please sign in to comment.