Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fuzz.constant(Void) fatal error #20

Open
ariady-putra opened this issue Sep 27, 2024 · 0 comments
Open

fuzz.constant(Void) fatal error #20

ariady-putra opened this issue Sep 27, 2024 · 0 comments

Comments

@ariady-putra
Copy link

When using constant(Void) like,

test property_test(vs via fuzz.list_between(fuzz.constant(Void), 5, 10)) {
  // DO NOT MODIFY BELOW //
  let len = vs |> list.length
  len < 5
  // DO NOT MODIFY ABOVE //
}

(also tried with Tuple like constant((Void, ..)) -- I think it's involving Void)

When running aiken check it throws,

$ aiken c
    Compiling ariady-putra-emurgo/aiken_check_exercise 0.0.0 (.)
    Compiling aiken-lang/stdlib v2.1.0 (./build/packages/aiken-lang-stdlib)
    Compiling aiken-lang/fuzz v2.1.0 (./build/packages/aiken-lang-fuzz)
      Testing ...
  Simplifying counterexample from 1 choices
  Simplifying counterexample from 1 choices
   Simplified counterexample in 0ms after 4 steps
  Simplifying counterexample from 2 choices
   Simplified counterexample in 0ms after 4 steps
  Simplifying counterexample from 7 choices
   Simplified counterexample in 3ms after 14 steps
   Simplified counterexample in 8ms after 84 steps

   aiken::fatal::error
   Whoops! You found a bug in the Aiken compiler.
   
   Please report this error at https://github.com/aiken-lang/aiken/issues/new.
   In your bug report please provide the information below and if possible the code
   that produced it.
   
   Operating System: linux
   Architecture:     x86_64
   Version:          v1.1.3+unknown
   
   /home/ariady/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aiken-lang-1.1.3/src/test_framework.rs:1082:26
   
       failed to reify counterexample?: "invalid type annotation App { public: true, contains_opaque: false, module: \"\", name: \"Void\", args: [], alias: None } for 0st constructor with fields: []"

The corresponding test_framework.rs:

impl PropertyTestResult<PlutusData> {
    pub fn reify(
        self,
        data_types: &IndexMap<&DataTypeKey, &TypedDataType>,
    ) -> PropertyTestResult<UntypedExpr> {
        PropertyTestResult {
            counterexample: self.counterexample.map(|ok| {
                ok.map(|counterexample| {
                    UntypedExpr::reify_data(data_types, counterexample, &self.test.fuzzer.type_info)
                        .expect("failed to reify counterexample?")
                })
            }),
            iterations: self.iterations,
            test: self.test,
            labels: self.labels,
            traces: self.traces,
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant