Update tests; Set bin name; Increment version
This commit is contained in:
parent
33bacfc100
commit
d4ad3c8ddd
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -915,7 +915,7 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650"
|
||||
|
||||
[[package]]
|
||||
name = "dust-lang"
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
dependencies = [
|
||||
"ansi_term",
|
||||
"cc",
|
||||
|
@ -1,11 +1,15 @@
|
||||
[package]
|
||||
name = "dust-lang"
|
||||
description = "Data-Oriented Programming Language"
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
repository = "https://github.com/tree-sitter/tree-sitter-dust"
|
||||
edition = "2018"
|
||||
license = "MIT"
|
||||
|
||||
[[bin]]
|
||||
name = "dust"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
ansi_term = "0.12.1"
|
||||
chrono = "0.4.31"
|
||||
|
@ -10,7 +10,7 @@ take_turn = function <current_room opponent_card> {
|
||||
|
||||
remove_card = function <opponent_card> {
|
||||
for card_list in cards {
|
||||
removed_card = remove card from cards {
|
||||
remove card from cards {
|
||||
card == opponent_card
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
foo = "bar";
|
||||
func = 'foo';
|
||||
foo = "bar"
|
||||
func = function <> { "foo" }
|
||||
|
||||
assert_equal("bar", func());
|
||||
assert_equal("bar", (func))
|
||||
|
||||
foo = "xyz";
|
||||
foo = "xyz"
|
||||
|
||||
assert_equal("xyz", func());
|
||||
assert_equal("xyz", (func))
|
||||
|
||||
|
@ -1,29 +1,24 @@
|
||||
table = create_table(
|
||||
("text", "number", "bool"),
|
||||
(
|
||||
("a", 1, true),
|
||||
("b", 2, true),
|
||||
("a", 3, true)
|
||||
)
|
||||
);
|
||||
table = create_table <text number bool> [
|
||||
["a", 1, true]
|
||||
["b", 2, true]
|
||||
["a", 3, true]
|
||||
]
|
||||
|
||||
test_table = create_table(
|
||||
("text", "bool"),
|
||||
(
|
||||
("a", true),
|
||||
("b", true),
|
||||
("a", true)
|
||||
)
|
||||
);
|
||||
test_table = create_table <text bool> [
|
||||
["a", true]
|
||||
["b", true]
|
||||
["a", true]
|
||||
]
|
||||
|
||||
assert_equal(select(table, ("text", "bool")), test_table);
|
||||
select = select <text bool> from table
|
||||
|
||||
test_table = create_table(
|
||||
("text", "number", "bool"),
|
||||
(
|
||||
("a", 1, true),
|
||||
("a", 3, true)
|
||||
)
|
||||
);
|
||||
(assert_equal select, test_table)
|
||||
|
||||
assert_equal(where(table, 'text == "a"'), test_table);
|
||||
test_table = create_table <text number bool> [
|
||||
["a", 1, true]
|
||||
["a", 3, true]
|
||||
]
|
||||
|
||||
select_where = select * from table where text == "a"
|
||||
|
||||
assert_equal(select_where, test_table);
|
||||
|
@ -1,8 +1,8 @@
|
||||
x = 1
|
||||
y = "hello dust!"
|
||||
z = 42.0
|
||||
list = (3, 2, x)
|
||||
big_list = (x, y, z, list)
|
||||
list = [3, 2, x]
|
||||
big_list = [x, y, z, list]
|
||||
foo = {
|
||||
x = "bar"
|
||||
y = 42
|
||||
|
@ -45,8 +45,8 @@ fn find_loop() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fizz_buzz() {
|
||||
let file_contents = read_to_string("examples/fizz_buzz.ds").unwrap();
|
||||
fn fizzbuzz() {
|
||||
let file_contents = read_to_string("examples/fizzbuzz.ds").unwrap();
|
||||
|
||||
evaluate(&file_contents).unwrap();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user