KtorZ
0e0bed3c9d
Collect traces from last prop-test run on failure
2024-03-10 19:24:25 +01:00
KtorZ
d4069148c7
Remove UnitTestResult's output field
...
Dead-code. Also renamed 'logs' to 'traces'.
2024-03-10 19:00:01 +01:00
KtorZ
be7d07fa99
Always show test traces (unless manually turned off with flag)
...
On both failures and success.
2024-03-10 18:53:11 +01:00
KtorZ
c169596c76
preserve type-aliases from annotations on calls.
2024-03-10 00:38:03 +01:00
KtorZ
191e4d47b3
Remove dead-code: 'Layer'
2024-03-09 23:14:44 +01:00
Matthias Benkort
ec18127191
Merge pull request #869 from aiken-lang/non-serialisable-types
...
Forbid non-serializable inhabitants in compound data-types.
2024-03-09 22:39:41 +01:00
KtorZ
80a9393db7
Add --include-dependencies to 'aiken docs'
...
Fixes #867 .
2024-03-09 22:35:38 +01:00
KtorZ
ee54266d1f
Forbid non-serializable inhabitants in compound data-types.
2024-03-09 22:25:51 +01:00
KtorZ
37627e3527
Fix indentation of pipelines.
2024-03-09 20:44:51 +01:00
KtorZ
6ba74125c7
Remove extra newlines in test report and only print coverage on success.
2024-03-09 20:32:42 +01:00
KtorZ
22b86a5f82
Add --max-success for running more or less prop runs on demand.
2024-03-09 19:17:57 +01:00
KtorZ
d581183cc6
Fix formatter discarding nul bytes.
2024-03-09 18:59:35 +01:00
microproofs
b761d6a76d
fix: function aliases were leading to free uniques
2024-03-09 12:46:12 -05:00
microproofs
bffa678178
fix: mutually recursive zero arg functions needed to have their function bodies delayed
2024-03-09 10:04:30 -05:00
Matthias Benkort
7f0df40b4e
Merge pull request #862 from SundaeSwap-finance/pi/summary-check-count
...
Include the number of tests / checks run as part of the summary
2024-03-09 13:10:16 +01:00
microproofs
c51741cc35
fix: mutually recursive zero arg function calls were reaching an unreachable
2024-03-08 22:58:03 -05:00
Pi Lanningham
ebd6c3a56e
Cargo fmt
2024-03-08 20:43:27 -05:00
Pi Lanningham
ace58e368c
Correctly report the checks count
...
It might be slightly cleaner and more extensible to change to return a summary, potentially even making track the tests, coverage, etc. so it can be serialized to JSON. But, for now, this is much simpler, and the approach that KtorZ suggested.
2024-03-08 20:40:50 -05:00
KtorZ
77faee672e
cargo fmt --all
2024-03-09 01:28:48 +01:00
KtorZ
bbe7c0bc01
report prop test coverage labels on success.
2024-03-09 01:28:29 +01:00
KtorZ
96da70149d
Count labels in properties.
...
We'll piggyback on the tracing capabilities of the VM to provide labelling for prop tests. To ensure we do not interfere with normal traces, we only count traces that starts with a NUL byte as label. That convention is assumed to be known of the companion fuzz library that should then provide the labelling capabilities as a dedicated function.
2024-03-09 01:28:29 +01:00
KtorZ
d6cc9bdfbe
Allow implicit discard when right-hand side is Void.
...
This is the most intuitive/expected behavior. Otherwise, it forces a pointless let-binding to 'Void' or into a discard.
2024-03-09 01:28:29 +01:00
rvcas
cb0ae0c074
feat: impl some conversion methods on CheckedModule
2024-03-08 19:19:07 -05:00
rvcas
d55b7844f0
feat: impl serde for TypeAliasAnnotation
2024-03-08 19:19:07 -05:00
rvcas
2b5ed95df5
feat: serialize as cbor
2024-03-08 19:19:07 -05:00
rvcas
836e853827
fix: bring back vec1
2024-03-08 19:19:07 -05:00
rvcas
9d99b509b2
chore: this should be gone
2024-03-08 19:19:07 -05:00
rvcas
fe6710935d
feat: impl serde on errythang
2024-03-08 19:19:07 -05:00
Pi Lanningham
e944f10372
Add an optional check count; when we run a command that runs tests, we can set this to Some(x) and it'll print in the summary
2024-03-08 17:36:32 -05:00
KtorZ
a9d596f4cb
Memoize simplification steps during property-based shrinking.
...
I've been benchmarking that through the shrink of 'large' lists, and the cache brings about 1.5x speed increase. For small and simple cases, the cache as no visible effects (positive or negative).
2024-03-08 18:58:51 +01:00
KtorZ
a578728a94
Resolve type aliases based on inferred types.
...
Before this commit, we would always show the 'declared form' of type aliases, with their generic, non-instantiated parameters. This now tries to unify the annotation with the underlying inferred type to provide even better alias pretty printing.
2024-03-08 16:01:21 +01:00
KtorZ
ed9f5c6ef7
Preserve TypeAlias in types for better context/feedback.
2024-03-08 15:59:33 +01:00
KtorZ
877d10ef22
Use inferred Fuzzer inner type for unify error when possible.
2024-03-08 15:57:41 +01:00
microproofs
eb07365e73
fix tests
2024-03-08 00:12:44 -05:00
microproofs
94f383762c
step up the optimizations a bit more by inlining a small function
2024-03-08 00:12:44 -05:00
microproofs
bf429fbdbf
remove unused import
2024-03-08 00:12:44 -05:00
microproofs
dcec8ecfe6
remove unused special function
2024-03-08 00:12:44 -05:00
microproofs
541d96f558
remove comment line
2024-03-08 00:12:44 -05:00
microproofs
275db2fd11
update tests
2024-03-08 00:12:44 -05:00
microproofs
ae396c0224
Fix opaque type destructuring in code gen
2024-03-08 00:12:44 -05:00
microproofs
1edd1a1fa3
change currying to happen with 3 or more occurrences
2024-03-08 00:12:44 -05:00
microproofs
e9122de061
more identity reduce testing
2024-03-08 00:12:44 -05:00
microproofs
dabaae8ca6
more identity and inline tests
2024-03-08 00:12:44 -05:00
microproofs
97b0cf6813
reorganize shrinker tests
2024-03-08 00:12:44 -05:00
microproofs
eb709d6fc3
reorder tests to match order of functions
2024-03-08 00:12:44 -05:00
rvcas
fab6d5aff7
chore: fix fmt
2024-03-07 19:32:33 -05:00
KtorZ
8e558d893f
Only reify unit tests assertions on failure.
2024-03-07 19:07:55 +01:00
KtorZ
0d599f7e2d
re-add missing newline after test blocks.
2024-03-07 18:28:21 +01:00
KtorZ
23a22a65cb
Handle (recursive) generic types during reification.
...
Also moved a bunch of functions from code-gen back into _tipo_, as
they're better suited and generic enough to be reused elsewhere.
2024-03-07 18:07:52 +01:00
microproofs
a3fbe6c155
fix tests
2024-03-06 23:27:10 -05:00
microproofs
e217423145
mixed up pair builtin
2024-03-06 23:27:10 -05:00
microproofs
bdd84dc952
fixing the tests lead to me create a new function for converting from data
2024-03-06 23:27:10 -05:00
microproofs
892da06e14
add more runtime checking for a few of the data to primitive conversions
2024-03-06 23:27:10 -05:00
KtorZ
0f926d3c31
Fix code-gen tests due to associativity change.
2024-03-07 01:28:51 +01:00
KtorZ
bff822ea7f
Rework unit test report to leverage new reification
...
And also provide slightly better errors when traces, or trace-if-false operators are present.
2024-03-07 01:20:40 +01:00
KtorZ
59996850c1
Implement 'reify_constant' and rename reify to 'reify_data'
...
Both fullfill similar goal, but reify_constant sits one level above.
2024-03-07 01:17:06 +01:00
KtorZ
8ffa68d2f0
Fix && and || associativity.
...
Somehow, these have always been right-associative, when the natural thing to expect is left-associativity. It now matters when trying to crawl down binary tree to display them properly.
2024-03-07 01:17:05 +01:00
rvcas
c9ab1aec98
chore: consume errs instead of cloning
2024-03-06 18:20:14 -05:00
rvcas
f8377af0c8
feat(parse): run in parallel
2024-03-06 18:16:07 -05:00
rvcas
9c5556aa1e
feat(deps): remove tests from ast and ignore warnings
2024-03-06 18:16:07 -05:00
rvcas
25ebdc2527
fix: validator args unexpectedly unbound
...
closes #852
2024-03-06 14:15:00 -05:00
rvcas
ad4840958c
chore: add test for validator args with no annotation
2024-03-06 11:19:32 -05:00
Matthias Benkort
f14bab69c0
Merge pull request #851 from aiken-lang/update-built
...
update package dependency
2024-03-06 17:11:05 +01:00
microproofs
2bc433f61e
fix: need to use temp_term for counting var occurrences in identity reducer
...
chore: Adding more shrinker tests and fixed some of the existing ones
2024-03-05 12:08:18 -05:00
microproofs
b146db8c95
update package dependency
2024-03-05 10:23:29 -05:00
KtorZ
966a20f691
Fix run_n_times for properties expected to fail.
2024-03-04 23:41:37 +01:00
KtorZ
4d432513e0
Fix interesting case identification for properties expected to fail.
2024-03-04 23:28:45 +01:00
KtorZ
4097d1edb2
Fix negative integer literal parsing in fuzzer DSL.
2024-03-04 23:27:23 +01:00
KtorZ
fbeb611e5f
Show counter examples in green when property is expected to fail.
2024-03-04 20:41:04 +01:00
KtorZ
3e922c0a52
Allow primitive literals, lists and tuples in fuzzer expressions.
2024-03-04 20:41:04 +01:00
rvcas
c7cd89d127
chore: fix fmt
2024-03-04 13:03:07 -05:00
KtorZ
df3baa082e
Remove 'seed' arg from 'with_project' to FinishedTests event
...
Also polish a bit the output of tests, move test result to stdout to allow filtering out warnings by redirecting stderr to /dev/null.
2024-03-04 18:43:51 +01:00
microproofs
c9dd281b45
disable assert that was blocking issue #844
2024-03-04 11:48:22 -05:00
microproofs
27eb1a3e04
Change all uses of interning besides the uplc parser to use the new CodeGenInterner
2024-03-04 11:03:23 -05:00
microproofs
d971d9818b
update tests and ensure identity reducer handles no_inline lambda
2024-03-04 10:52:56 -05:00
microproofs
af6c107187
remove unneeded assert
2024-03-04 10:52:56 -05:00
microproofs
06ca22c26a
update inliner to handle no_inline functions
2024-03-04 10:52:56 -05:00
microproofs
4e928f39db
start adding no inline flag to functions
2024-03-04 10:52:56 -05:00
microproofs
2aaa46e54c
remove print
2024-03-04 10:52:56 -05:00
microproofs
c6ef37cc5c
checkpoint
2024-03-04 10:52:56 -05:00
microproofs
4e0aaf970f
update tests and fix final unique issues
2024-03-04 10:52:56 -05:00
microproofs
62963f7fc2
feat: finish curry optmization, improve inline optimization further, and add a subtract integer to add integer conversion
2024-03-04 10:52:56 -05:00
microproofs
7d8fdc0f22
prevent curried function hoisting if occurrences is 0
2024-03-04 10:52:56 -05:00
microproofs
258b5abf23
now currying works
2024-03-04 10:52:56 -05:00
microproofs
3b55a32583
finish up curry optimization on builtins
2024-03-04 10:52:56 -05:00
microproofs
58d586c5cf
large refactor to reduce complexity
2024-03-04 10:52:56 -05:00
microproofs
8f84eb382f
commit some changes so far
2024-03-04 10:52:56 -05:00
microproofs
9a52258e14
chugging along with a small refactor and some more work toward currying
2024-03-04 10:52:56 -05:00
microproofs
2f72510102
chore: Add back curry code removed in a previous commit
2024-03-04 10:52:56 -05:00
KtorZ
8e8e0de044
cargo fmt --all
2024-03-04 14:46:16 +01:00
KtorZ
362acd43a3
Rework and optimize PRNG
...
Using ByteArrays as vectors on-chain is a lot more efficient than relying on actul Data's list of values. From the Rust end, it doesn't change much as we were already manipulating vectors anyway.
2024-03-04 14:27:16 +01:00
KtorZ
dd1c7d675f
Allow Aiken files to have more than one dot-separated suffix.
2024-03-04 00:15:05 +01:00
KtorZ
50faf81c0f
Use u64 for PRNG choices.
2024-03-04 00:14:34 +01:00
KtorZ
900b73b21a
cargo fmt --all
2024-03-03 21:05:43 +01:00
KtorZ
fbda31d980
Fix and improve test outputs for prop tests.
2024-03-03 21:00:51 +01:00
KtorZ
7a2537432a
Accept an optional --seed parameter for check, otherwise default to random.
...
Also, show the seed on failure.
2024-03-03 20:36:01 +01:00
KtorZ
a7b9d4bb22
Use u8 for fuzzer choices instead of u32
...
Value is bounded between 0 and 255.
2024-03-03 19:38:49 +01:00
KtorZ
30841fe000
Rework generate_raw to avoid need to intern in prop tests
...
Also, this commit makes `apply_term` automatically re-intern the
program since it isn't safe to apply any term onto a UPLC program. In
particular, terms that introduce new let-bindings (via lambdas) will
mess with the already generated DeBruijn indices.
The problem doesn't occur for pure constant terms like Data. So we
still have a safe and fast version 'apply_data' when needed.
2024-03-03 19:33:27 +01:00
KtorZ
1134b8d7d0
Register tests as callable definitions.
...
Also move the registering of validators into the same place as they
other and define a little cute function to avoid code-duplication.
2024-03-03 19:33:27 +01:00
KtorZ
c2dc47fa0b
Refactor creation of CodeGenerator and management of known data_types and functions.
...
This was a mess to say to the least. The mess started when we wanted
to make all definitions in codegen use immutable maps of references --
which was and still is a good idea. Yet, the population of the data
types and functions definitions was done somehow in a separate step,
in a rather ad-hoc manner.
This commit changes that to ensure the project's data_types and
functions are populated while type checking the AST such that we need
not to redo it after.
The code for registering the data type definitions and function
definitions was also duplicated in at least 3 places. It is now a
method of the TypedModule.
Note: this change isn't only just cosmetic, it's also necessary for
the commit that follows which aims at adding tests to the set of
available function definitions, thus allowing to make property tests
callable.
2024-03-03 19:33:26 +01:00