Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: ci #9

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/mdlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run: /bin/bash -c "$(curl -fsSL https://cli.moonbitlang.com/ubuntu_x86_64_moon_setup.sh)"

- name: Get changed files
id: changed-fiels
id: changed-files
uses: tj-actions/changed-files@v43

- name: Run mdlint
Expand Down
12 changes: 6 additions & 6 deletions course2/lec2_script.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ fn num_water_bottles(num_bottles: Int, num_exchange: Int) -> Int {
// 条件表达式
if num_bottles >= num_exchange {
// 数据绑定
num_bottles := num_bottles - num_exchange + 1
num_drunk := num_drunk + num_exchange
let num_bottles = num_bottles - num_exchange + 1
let num_drunk = num_drunk + num_exchange
// 函数运算
consume(num_bottles, num_drunk)
} else {
Expand All @@ -61,11 +61,11 @@ fn num_water_bottles(num_bottles: Int, num_exchange: Int) -> Int {
consume(num_bottles, 0)
}

// 程序入口
fn init {
// 程序测试
test {
// 命令
assert(num_water_bottles(9, 3) == 13)
assert(num_water_bottles(15, 4) == 19)
@assertion.assert_eq(num_water_bottles(9, 3), 13)?
@assertion.assert_eq(num_water_bottles(15, 4), 19)?
}
```

Expand Down