From 56eee0fcf37f0be8a63d61eb1a3c54eacff046e3 Mon Sep 17 00:00:00 2001 From: ysthakur <45539777+ysthakur@users.noreply.github.com> Date: Mon, 16 Dec 2024 18:26:27 -0500 Subject: [PATCH] Remove fuzz test case that I was debugging --- src/test/scala/fred/FuzzTests.scala | 271 +--------------------------- 1 file changed, 2 insertions(+), 269 deletions(-) diff --git a/src/test/scala/fred/FuzzTests.scala b/src/test/scala/fred/FuzzTests.scala index 1eda832..a4069a0 100644 --- a/src/test/scala/fred/FuzzTests.scala +++ b/src/test/scala/fred/FuzzTests.scala @@ -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 @@ -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,