1
0

Update tests; Set bin name; Increment version

This commit is contained in:
Jeff 2023-10-18 22:27:57 -04:00
parent 33bacfc100
commit d4ad3c8ddd
7 changed files with 36 additions and 37 deletions

2
Cargo.lock generated
View File

@ -915,7 +915,7 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650"
[[package]] [[package]]
name = "dust-lang" name = "dust-lang"
version = "0.3.0" version = "0.3.1"
dependencies = [ dependencies = [
"ansi_term", "ansi_term",
"cc", "cc",

View File

@ -1,11 +1,15 @@
[package] [package]
name = "dust-lang" name = "dust-lang"
description = "Data-Oriented Programming Language" description = "Data-Oriented Programming Language"
version = "0.3.0" version = "0.3.1"
repository = "https://github.com/tree-sitter/tree-sitter-dust" repository = "https://github.com/tree-sitter/tree-sitter-dust"
edition = "2018" edition = "2018"
license = "MIT" license = "MIT"
[[bin]]
name = "dust"
path = "src/main.rs"
[dependencies] [dependencies]
ansi_term = "0.12.1" ansi_term = "0.12.1"
chrono = "0.4.31" chrono = "0.4.31"

View File

@ -10,7 +10,7 @@ take_turn = function <current_room opponent_card> {
remove_card = function <opponent_card> { remove_card = function <opponent_card> {
for card_list in cards { for card_list in cards {
removed_card = remove card from cards { remove card from cards {
card == opponent_card card == opponent_card
} }
} }

View File

@ -1,9 +1,9 @@
foo = "bar"; foo = "bar"
func = 'foo'; func = function <> { "foo" }
assert_equal("bar", func()); assert_equal("bar", (func))
foo = "xyz"; foo = "xyz"
assert_equal("xyz", func()); assert_equal("xyz", (func))

View File

@ -1,29 +1,24 @@
table = create_table( table = create_table <text number bool> [
("text", "number", "bool"), ["a", 1, true]
( ["b", 2, true]
("a", 1, true), ["a", 3, true]
("b", 2, true), ]
("a", 3, true)
)
);
test_table = create_table( test_table = create_table <text bool> [
("text", "bool"), ["a", true]
( ["b", true]
("a", true), ["a", true]
("b", true), ]
("a", true)
)
);
assert_equal(select(table, ("text", "bool")), test_table); select = select <text bool> from table
test_table = create_table( (assert_equal select, test_table)
("text", "number", "bool"),
(
("a", 1, true),
("a", 3, true)
)
);
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);

View File

@ -1,8 +1,8 @@
x = 1 x = 1
y = "hello dust!" y = "hello dust!"
z = 42.0 z = 42.0
list = (3, 2, x) list = [3, 2, x]
big_list = (x, y, z, list) big_list = [x, y, z, list]
foo = { foo = {
x = "bar" x = "bar"
y = 42 y = 42

View File

@ -45,8 +45,8 @@ fn find_loop() {
} }
#[test] #[test]
fn fizz_buzz() { fn fizzbuzz() {
let file_contents = read_to_string("examples/fizz_buzz.ds").unwrap(); let file_contents = read_to_string("examples/fizzbuzz.ds").unwrap();
evaluate(&file_contents).unwrap(); evaluate(&file_contents).unwrap();
} }