rename 'constr_{fields,index}' to 'unconstr_{field,index}'
Better match the conventions so far used across the existing builtins.
This commit is contained in:
@@ -1,12 +1,23 @@
|
||||
use aiken/builtin.{constr_index}
|
||||
use aiken/builtin.{unconstr_fields, unconstr_index}
|
||||
|
||||
test baz() {
|
||||
test bar() {
|
||||
let x = Some("bar")
|
||||
|
||||
expect [bar] = x |> builtin.constr_fields
|
||||
expect [bar] = x |> builtin.unconstr_fields
|
||||
|
||||
and {
|
||||
constr_index(x) == 0,
|
||||
unconstr_index(x) == 0,
|
||||
builtin.un_b_data(bar) == "bar",
|
||||
}
|
||||
}
|
||||
|
||||
test baz() {
|
||||
let x = Some("baz")
|
||||
|
||||
expect [baz] = x |> unconstr_fields
|
||||
|
||||
and {
|
||||
builtin.unconstr_index(x) == 0,
|
||||
builtin.un_b_data(baz) == "baz",
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user