Skip to content

Commit

Permalink
Added tests for incrementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Armd04 committed Sep 24, 2024
1 parent d07ed7c commit c6da08e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions crates/tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,31 @@ async fn arithmetic() {
.assert_stdout("16\n")
.run()
.await;

TestBuilder::new()
.command("echo $((a=1, ++a))")
.assert_stdout("2\n")
.run()
.await;

TestBuilder::new()
.command("echo $((a=1, a++))")
.assert_stdout("1\n")
.run()
.await;

TestBuilder::new()
.command("echo $((a=1, a--))")
.assert_stdout("1\n")
.run()
.await;

TestBuilder::new()
.command("echo $((a=1, --a))")
.assert_stdout("0\n")
.run()
.await;

}

#[tokio::test]
Expand Down

0 comments on commit c6da08e

Please sign in to comment.