mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-22 18:19:54 -04:00
This is a breaking change for the language. However it makes a number of things easier. Like importing specific symbols from a file. adds: #28
17 lines
377 B
Plaintext
17 lines
377 B
Plaintext
let tpl = import "../tuples.ucg";
|
|
let t = (import "../testing.ucg").asserts{};
|
|
|
|
assert t.equal{
|
|
left = tpl.fields{tpl={foo=1, bar=2}}.result,
|
|
right = ["foo", "bar"],
|
|
};
|
|
|
|
assert t.equal{
|
|
left = tpl.values{tpl={foo=1, bar=2}}.result,
|
|
right = [1, 2],
|
|
};
|
|
|
|
assert t.equal{
|
|
left = tpl.enumerate{tpl={foo=1, bar=2}}.result,
|
|
right = [["foo", 1], ["bar", 2]],
|
|
}; |