Skip to content

Commit

Permalink
Update some E2E tests for separation of Ord and Eq
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchmindtree committed Feb 28, 2022
1 parent 2910296 commit 05be535
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions test/src/e2e_vm_tests/test_programs/asm_expr_basic/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ name = "asm_expr_basic"
entry = "main.sw"

[dependencies]
core = { git = "http://github.com/FuelLabs/sway-lib-core" }
std = { git = "http://github.com/FuelLabs/sway-lib-std" }
core = { git = "http://github.com/FuelLabs/sway-lib-core", tag = "v0.0.1" }
std = { git = "http://github.com/FuelLabs/sway-lib-std", tag = "v0.0.1" }
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ fn main() -> u64 {
Y: bool,
}

impl core::ops::Ord for X {
impl core::ops::Eq for X {
fn eq(self, other: Self) -> bool {
asm(r1: self, r2: other, r3) {
eq r3 r2 r1;
r3: bool
}
}
}

impl core::ops::Ord for X {
fn lt(self, other: Self) -> bool {
asm(r1: self, r2: other, r3) {
lt r3 r2 r1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ entry = "main.sw"
license = "Apache-2.0"
name = "if_elseif_enum"


[dependencies]
core = { git = "http://github.com/FuelLabs/sway-lib-core", tag = "v0.0.1" }
std = { git = "http://github.com/FuelLabs/sway-lib-std", tag = "v0.0.1" }
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
script;

use core::ops::Ord;
use core::ops::{Eq, Ord};

enum X {
Y: (),
}

impl Ord for X {
impl Eq for X {
fn eq(self, other: Self) -> bool {
true
}
}

impl Ord for X {
fn lt(self, other: Self) -> bool {
false
}
Expand Down

0 comments on commit 05be535

Please sign in to comment.