Skip to content

Commit b4e8957

Browse files
committed
fix: fix tests
1 parent 84c2274 commit b4e8957

File tree

11 files changed

+227
-99
lines changed

11 files changed

+227
-99
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
uses: orhun/git-cliff-action@v3
4343
id: git-cliff
4444
with:
45-
args: -vv --latest --strip header
45+
args: -vv --current --strip header
4646
env:
4747
OUTPUT: CHANGES.md
4848
- name: Release

CHANGELOG.md

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
## [unreleased]
5+
## [0.0.1-alpha.15] - 2024-03-13
66

77
### 🚀 Features
88

99
- Module file declarations, fixes
1010

11+
### 🐛 Bug Fixes
12+
13+
- Fix
14+
15+
- Fix multi file function resolution
16+
17+
- Fix scope
18+
19+
1120
## [0.0.1-alpha.14] - 2024-03-11
1221

1322
### 🐛 Bug Fixes
@@ -28,6 +37,8 @@ All notable changes to this project will be documented in this file.
2837

2938
- Fix span in lalrpop
3039
- Fix on type qualifier lowering
40+
- Fix ci2
41+
3142

3243
### ⚙️ Miscellaneous Tasks
3344

@@ -97,6 +108,11 @@ All notable changes to this project will be documented in this file.
97108

98109
- Struct support
99110

111+
### 🧪 Testing
112+
113+
- Test
114+
115+
100116
## [0.0.1-alpha.7] - 2024-02-17
101117

102118
### 🚀 Features
@@ -114,13 +130,17 @@ All notable changes to this project will be documented in this file.
114130
### 🐛 Bug Fixes
115131

116132
- Fix a miscompilation
133+
- Fixes
134+
117135

118136
## [0.0.1-alpha.5] - 2024-02-14
119137

120138
### 🐛 Bug Fixes
121139

122140
- *(linker)* Fix linker on distros like ubuntu
123141
- *(ci)* Ci improvements
142+
- Fix ci
143+
124144

125145
## [0.0.1-alpha.4] - 2024-02-14
126146

@@ -156,6 +176,11 @@ All notable changes to this project will be documented in this file.
156176

157177
- Compile ifs
158178

179+
### 🐛 Bug Fixes
180+
181+
- Fix
182+
183+
159184
### 🎨 Styling
160185

161186
- Format
@@ -166,4 +191,29 @@ All notable changes to this project will be documented in this file.
166191
- Update deps
167192
- Update version
168193

194+
## [0.0.1-alpha.1] - 2024-02-09
195+
196+
### 🐛 Bug Fixes
197+
198+
- Fix double return
199+
200+
- Fixes
201+
202+
- Fix
203+
204+
- Fix
205+
206+
207+
### 🎨 Styling
208+
209+
- Style
210+
211+
212+
### ⚙️ Miscellaneous Tasks
213+
214+
- Ci
215+
216+
- Ci
217+
218+
169219
<!-- generated by git-cliff -->

cliff.toml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# git-cliff ~ default configuration file
2+
# https://git-cliff.org/docs/configuration
3+
#
4+
# Lines starting with "#" are comments.
5+
# Configuration options are organized into tables and keys.
6+
# See documentation for more information on available options.
7+
8+
[changelog]
9+
# changelog header
10+
header = """
11+
# Changelog\n
12+
All notable changes to this project will be documented in this file.\n
13+
"""
14+
# template for the changelog body
15+
# https://keats.github.io/tera/docs/#introduction
16+
body = """
17+
{% if version %}\
18+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
19+
{% else %}\
20+
## [unreleased]
21+
{% endif %}\
22+
{% for group, commits in commits | group_by(attribute="group") %}
23+
### {{ group | striptags | trim | upper_first }}
24+
{% for commit in commits %}
25+
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
26+
{% if commit.breaking %}[**breaking**] {% endif %}\
27+
{{ commit.message | upper_first }}\
28+
{% endfor %}
29+
{% endfor %}\n
30+
"""
31+
# template for the changelog footer
32+
footer = """
33+
<!-- generated by git-cliff -->
34+
"""
35+
# remove the leading and trailing s
36+
trim = true
37+
# postprocessors
38+
postprocessors = [
39+
# { pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL
40+
]
41+
42+
[git]
43+
# parse the commits based on https://www.conventionalcommits.org
44+
conventional_commits = true
45+
# filter out the commits that are not conventional
46+
filter_unconventional = false
47+
# process each line of a commit as an individual commit
48+
split_commits = false
49+
# regex for preprocessing the commit messages
50+
commit_preprocessors = [
51+
# Replace issue numbers
52+
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
53+
# Check spelling of the commit with https://github.com/crate-ci/typos
54+
# If the spelling is incorrect, it will be automatically fixed.
55+
#{ pattern = '.*', replace_command = 'typos --write-changes -' },
56+
]
57+
# regex for parsing and grouping commits
58+
commit_parsers = [
59+
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
60+
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
61+
{ message = "^doc", group = "<!-- 3 -->📚 Documentation" },
62+
{ message = "^perf", group = "<!-- 4 -->⚡ Performance" },
63+
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
64+
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
65+
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
66+
{ message = "^chore\\(release\\): prepare for", skip = true },
67+
{ message = "^chore\\(deps.*\\)", skip = true },
68+
{ message = "^chore\\(pr\\)", skip = true },
69+
{ message = "^chore\\(pull\\)", skip = true },
70+
{ message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" },
71+
{ body = ".*security", group = "<!-- 8 -->🛡️ Security" },
72+
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
73+
]
74+
# protect breaking changes from being skipped due to matching a skipping commit_parser
75+
protect_breaking_commits = false
76+
# filter out the commits that are not matched by commit parsers
77+
filter_commits = false
78+
# regex for matching git tags
79+
# tag_pattern = "v[0-9].*"
80+
# regex for skipping tags
81+
# skip_tags = ""
82+
# regex for ignoring tags
83+
# ignore_tags = ""
84+
# sort the tags topologically
85+
topo_order = false
86+
# sort the commits inside sections by oldest/newest order
87+
sort_commits = "oldest"
88+
# limit the number of commits included in the changelog.
89+
# limit_commits = 42

lib/edlang_driver/tests/programs.rs

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,19 @@ mod common;
1111
#[test_case(include_str!("programs/refs.ed"), "refs", false, 2, &[] ; "refs")]
1212
#[test_case(include_str!("programs/struct.ed"), "struct", false, 5, &[] ; "r#struct")]
1313
#[test_case(include_str!("programs/casts.ed"), "casts", false, 2, &[] ; "casts")]
14-
#[test_case(TEST_ADD, "TEST_ADD", false, 2, &[] ; "TEST_ADD")]
15-
#[test_case(TEST_SUB, "TEST_SUB", false, 1, &[] ; "TEST_SUB")]
16-
#[test_case(TEST_MUL, "TEST_MUL", false, 4, &[] ; "TEST_MUL")]
17-
#[test_case(TEST_DIV, "TEST_DIV", false, 2, &[] ; "TEST_DIV")]
18-
#[test_case(TEST_REM, "TEST_REM", false, 0, &[] ; "TEST_REM")]
19-
#[test_case(TEST_IF_BOTH, "TEST_IF_BOTH", false, 1, &[] ; "TEST_IF_BOTH")]
20-
#[test_case(TEST_IF_BOTH, "TEST_IF_BOTH", false, 2, &["a"] ; "TEST_IF_BOTH args")]
21-
#[test_case(TEST_IF_NO_ELSE, "TEST_IF_NO_ELSE", false, 1, &[] ; "TEST_IF_NO_ELSE")]
22-
#[test_case(TEST_IF_NO_ELSE, "TEST_IF_NO_ELSE", false, 2, &["a"] ; "TEST_IF_NO_ELSE args")]
14+
#[test_case(TEST_ADD, "test_add", false, 2, &[] ; "test_add")]
15+
#[test_case(TEST_SUB, "test_sub", false, 1, &[] ; "test_sub")]
16+
#[test_case(TEST_MUL, "test_mul", false, 4, &[] ; "TEST_MUL")]
17+
#[test_case(TEST_DIV, "test_div", false, 2, &[] ; "TEST_DIV")]
18+
#[test_case(TEST_REM, "test_rem", false, 0, &[] ; "TEST_REM")]
19+
#[test_case(TEST_IF_BOTH, "test_if_both", false, 1, &[] ; "test_if_both")]
20+
#[test_case(TEST_IF_BOTH, "test_if_both", false, 2, &["a"] ; "test_if_both_args")]
21+
#[test_case(TEST_IF_NO_ELSE, "test_if_no_else", false, 1, &[] ; "test_if_no_else")]
22+
#[test_case(TEST_IF_NO_ELSE, "test_if_no_else", false, 2, &["a"] ; "test_if_no_else_args")]
2323
fn example_tests(source: &str, name: &str, is_library: bool, status_code: i32, args: &[&str]) {
2424
let program = compile_program(source, name, is_library).unwrap();
2525

26+
dbg!(&program);
2627
assert!(program.binary_file.exists(), "program not compiled");
2728
let mut result = run_program(&program.binary_file, args).unwrap();
2829
let status = result.wait().unwrap();
@@ -35,63 +36,63 @@ fn example_tests(source: &str, name: &str, is_library: bool, status_code: i32, a
3536
}
3637

3738
const TEST_ADD: &str = r#"
38-
mod Main {
39+
3940
pub fn main() -> i32 {
4041
let b: i32 = 1 + 1;
4142
return b;
4243
}
43-
}
44+
4445
"#;
4546
const TEST_SUB: &str = r#"
46-
mod Main {
47+
4748
pub fn main() -> i32 {
4849
let b: i32 = 2 - 1;
4950
return b;
5051
}
51-
}
52+
5253
"#;
5354
const TEST_MUL: &str = r#"
54-
mod Main {
55+
5556
pub fn main() -> i32 {
5657
let b: i32 = 2 * 2;
5758
return b;
5859
}
59-
}
60+
6061
"#;
6162
const TEST_DIV: &str = r#"
62-
mod Main {
63+
6364
pub fn main() -> i32 {
6465
let b: i32 = 4 / 2;
6566
return b;
6667
}
67-
}
68+
6869
"#;
6970
const TEST_REM: &str = r#"
70-
mod Main {
71+
7172
pub fn main() -> i32 {
7273
let b: i32 = 4 % 2;
7374
return b;
7475
}
75-
}
76+
7677
"#;
7778
const TEST_IF_BOTH: &str = r#"
78-
mod Main {
79+
7980
pub fn main(argc: i32) -> i32 {
8081
if argc == 1 {
8182
return 1;
8283
} else {
8384
return 2;
8485
}
8586
}
86-
}
87+
8788
"#;
8889
const TEST_IF_NO_ELSE: &str = r#"
89-
mod Main {
90+
9091
pub fn main(argc: i32) -> i32 {
9192
if argc == 1 {
9293
return 1;
9394
}
9495
return 2;
9596
}
96-
}
97+
9798
"#;
Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
mod Main {
2-
fn add(a: i32, b: i32) -> i32 {
3-
return a + b;
4-
}
51

6-
fn check(a: i32) -> i32 {
7-
if a == 2 {
8-
return a;
9-
} else {
10-
return 0;
11-
}
12-
}
2+
fn add(a: i32, b: i32) -> i32 {
3+
return a + b;
4+
}
135

14-
pub fn main() -> i32 {
15-
let x: i32 = 2 + 3;
16-
let y: i32 = add(x, 4);
17-
return y;
6+
fn check(a: i32) -> i32 {
7+
if a == 2 {
8+
return a;
9+
} else {
10+
return 0;
1811
}
1912
}
13+
14+
pub fn main() -> i32 {
15+
let x: i32 = 2 + 3;
16+
let y: i32 = add(x, 4);
17+
return y;
18+
}
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
mod Main {
2-
3-
pub fn main(argc: i32, argv: *const *const u8) -> i64 {
4-
let a: i32 = 2;
5-
let b: i64 = a as i64;
6-
return b;
7-
}
1+
pub fn main(argc: i32, argv: *const *const u8) -> i64 {
2+
let a: i32 = 2;
3+
let b: i64 = a as i64;
4+
return b;
85
}
Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
mod Main {
2-
pub fn main() -> i32 {
3-
let b: i32 = factorial(4);
4-
return b;
5-
}
61

7-
fn factorial(n: i32) -> i32 {
8-
if n == 1 {
9-
return n;
10-
} else {
11-
return n * factorial(n - 1);
12-
}
2+
pub fn main() -> i32 {
3+
let b: i32 = factorial(4);
4+
return b;
5+
}
6+
7+
fn factorial(n: i32) -> i32 {
8+
if n == 1 {
9+
return n;
10+
} else {
11+
return n * factorial(n - 1);
1312
}
1413
}

0 commit comments

Comments
 (0)