Skip to content

Commit

Permalink
Adjusting tests and fixing ambiguity in execution
Browse files Browse the repository at this point in the history
  • Loading branch information
ACassimiro committed Sep 5, 2024
1 parent 0c902b5 commit df723ab
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 30 deletions.
1 change: 0 additions & 1 deletion rust-lite/src/rust_lite/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def exec_run(options: RunOptions) -> None:
print('Performed all possible rewriting operations; Trying to fetch the content of the K cell.')

module_manager.print_k_top_element()
module_manager.print_constants_cell()

def trigger_exec_run(stripped_args):
options = generate_options(stripped_args)
Expand Down
6 changes: 0 additions & 6 deletions rust-semantics/expression/literals.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,4 @@ module RUST-EXPRESSION-INTEGER-LITERALS
endmodule
module RUST-EXPRESSION-BOOLEAN-LITERALS
imports BOOL
imports RUST-SHARED-SYNTAX
rule true:LiteralExpression => true:Bool
endmodule
```
3 changes: 1 addition & 2 deletions rust-semantics/rust-common-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,7 @@ https://doc.rust-lang.org/reference/items/extern-crates.html
| ByteLiteral | ByteStringLiteral | RawByteStringLiteral
| CStringLiteral | RawCStringLiteral
| IntegerLiteral | FloatLiteral
| "true" | "false"
syntax CharLiteral ::= "TODO: not needed yet, not implementing"
// TODO: Not implemented properly
syntax StringLiteral ::= String
Expand Down
4 changes: 0 additions & 4 deletions tests/execution/arithmetic-expression.1.run

This file was deleted.

4 changes: 0 additions & 4 deletions tests/execution/arithmetic-expression.2.run

This file was deleted.

4 changes: 0 additions & 4 deletions tests/execution/arithmetic-expression.3.run

This file was deleted.

4 changes: 0 additions & 4 deletions tests/execution/arithmetic-expression.4.run

This file was deleted.

4 changes: 0 additions & 4 deletions tests/execution/arithmetic-expression.5.run

This file was deleted.

4 changes: 4 additions & 0 deletions tests/execution/integer-operations.1.run
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
new IntegerOperations;
call IntegerOperations.arithmetic_expression_mult_constant;
return_value;
check_eq 86400_u64
4 changes: 4 additions & 0 deletions tests/execution/integer-operations.2.run
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
new IntegerOperations;
call IntegerOperations.arithmetic_expression_div_constant;
return_value;
check_eq 2_u64
4 changes: 4 additions & 0 deletions tests/execution/integer-operations.3.run
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
new IntegerOperations;
call IntegerOperations.arithmetic_expression_sum_constant;
return_value;
check_eq 101_u64
4 changes: 4 additions & 0 deletions tests/execution/integer-operations.4.run
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
new IntegerOperations;
call IntegerOperations.arithmetic_expression_sub_constant;
return_value;
check_eq 99_u64
4 changes: 4 additions & 0 deletions tests/execution/integer-operations.5.run
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
new IntegerOperations;
call IntegerOperations.arithmetic_expression_mod_constant;
return_value;
check_eq 2_u64
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use multiversx_sc::imports::*;

#[multiversx_sc::contract]
pub trait ArithmeticExpression {
pub trait IntegerOperations {
#[init]
fn init(&self) {
}
Expand All @@ -22,4 +22,19 @@ pub trait ArithmeticExpression {

fn arithmetic_expression_mod_constant(&self) -> u64 { 5_u64 % 3_u64 }

fn relational_expression_equals(&self) -> bool {
let x = 5_u64 == 5_u64;
x
}

fn relational_expression_diff(&self) -> bool { 5_i64 != 5_i64 }

fn relational_expression_smaller_or_equal(&self) -> bool { 70_u128 <= 7_u128 }

fn relational_expression_greater_or_equal(&self) -> bool { 70_u128 >= 7_u128 }

fn relational_expression_smaller(&self) -> bool { 5_u32 < 7_u32 }

fn relational_expression_greater(&self) -> bool { 5_i32 < 7_i32 }

}

0 comments on commit df723ab

Please sign in to comment.