Skip to content

Commit

Permalink
Simple positive shadowing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jjcnn committed Jun 24, 2024
1 parent 36edd4b commit ff008ea
Show file tree
Hide file tree
Showing 19 changed files with 593 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[[package]]
name = "core"
source = "path+from-root-EE202EE2D1735C08"

[[package]]
name = "shadowing_in_reexporting_module"
source = "member"
dependencies = ["std"]

[[package]]
name = "std"
source = "path+from-root-EE202EE2D1735C08"
dependencies = ["core"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[project]
authors = ["Fuel Labs <contact@fuel.sh>"]
license = "Apache-2.0"
name = "shadowing_in_reexporting_module"
entry = "main.sw"
implicit-std = false

[dependencies]
std = { path = "../../../../../../../../sway-lib-std" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"configurables": [],
"functions": [
{
"attributes": null,
"inputs": [],
"name": "main",
"output": {
"name": "",
"type": 0,
"typeArguments": null
}
}
],
"loggedTypes": [],
"messagesTypes": [],
"types": [
{
"components": null,
"type": "u64",
"typeId": 0,
"typeParameters": null
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"configurables": [],
"encoding": "1",
"functions": [
{
"attributes": null,
"inputs": [],
"name": "main",
"output": {
"name": "",
"type": 0,
"typeArguments": null
}
}
],
"loggedTypes": [],
"messagesTypes": [],
"types": [
{
"components": null,
"type": "u64",
"typeId": 0,
"typeParameters": null
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
library;

pub struct Items1_Struct {
pub a: bool,
}

pub enum Items1_Enum {
A: bool,
B: bool,
}

pub const ITEMS_1_FUNCTION_RES = 456;

pub fn items_1_function() -> bool {
ITEMS_1_FUNCTION_RES == 456
}

pub trait Items1Trait<T> {
fn items_1_trait_function(self, x: T) -> bool;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
library;

pub struct Items2_Struct {
pub b: bool,
}

pub enum Items2_Enum {
C: bool,
D: bool,
}

pub const ITEMS_2_FUNCTION_RES = 789;

pub fn items_2_function() -> bool {
ITEMS_2_FUNCTION_RES == 789
}

pub trait Items2Trait<T> {
fn items_2_trait_function(self, x: T) -> bool;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
library;

pub struct Items2_Struct {
pub b: u64,
}

pub enum Items2_Enum {
C: u64,
D: u64,
}

pub const ITEMS_2_FUNCTION_RES = 987;

pub fn items_2_function() -> u64 {
ITEMS_2_FUNCTION_RES
}

pub trait Items2Trait<T> {
fn items_2_trait_function(self, x: T) -> u64;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
library;

pub struct Items3_Struct {
pub c: bool,
}

pub enum Items3_Enum {
E: bool,
F: bool,
}

pub enum Items3_Variants {
G: bool,
H: bool,
}

pub const ITEMS_3_FUNCTION_RES = 1234;

pub fn items_3_function() -> bool {
ITEMS_3_FUNCTION_RES == 1234
}

pub trait Items3Trait<T> {
fn items_3_trait_function(self, x: T) -> bool;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
library;

pub struct Items4_Struct {
pub d: bool,
}

pub enum Items4_Enum {
I: bool,
J: bool,
}

pub enum Items4_Variants {
K: bool,
L: bool,
}

pub const ITEMS_4_FUNCTION_RES = 5678;

pub fn items_4_function() -> bool {
ITEMS_4_FUNCTION_RES == 5678
}

pub trait Items4Trait<T> {
fn items_4_trait_function(self, x: T) -> bool;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
library;

pub struct Items4_Struct {
pub d: u64,
}

pub enum Items4_Enum {
I: u64,
J: u64,
}

pub enum Items4_Variants {
K: u64,
L: u64,
}

pub const ITEMS_4_FUNCTION_RES = 8765;

pub fn items_4_function() -> u64 {
ITEMS_4_FUNCTION_RES
}

pub trait Items4Trait<T> {
fn items_4_trait_function(self, x: T) -> u64;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
library;

pub enum Items4_Variants2 {
M: bool,
N: bool,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
library;

pub enum Items4_Variants2 {
M: u64,
N: u64,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
library;

pub use ::items_1::*;

pub struct Items1_Struct {
pub a: u64,
}

pub enum Items1_Enum {
A: u64,
B: u64,
}

pub const ITEMS_1_FUNCTION_RES = 654;

pub fn items_1_function() -> u64 {
ITEMS_1_FUNCTION_RES
}

pub trait Items1Trait<T> {
fn items_1_trait_function(self, x: T) -> u64;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
library;

pub use ::items_2_1::*;

pub use ::items_2_2::Items2_Struct;
pub use ::items_2_2::Items2_Enum;
pub use ::items_2_2::ITEMS_2_FUNCTION_RES;
pub use ::items_2_2::items_2_function;
pub use ::items_2_2::Items2Trait;
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
library;

pub use ::items_3_1::*;
pub use ::items_3_1::Items3_Variants::*;

pub struct Items3_Struct {
pub c: u64,
}

pub enum Items3_Enum {
E: u64,
F: u64,
}

pub enum Items3_Variants {
G: u64,
H: u64,
}

pub const ITEMS_3_FUNCTION_RES = 4321;

pub fn items_3_function() -> u64 {
ITEMS_3_FUNCTION_RES
}

pub trait Items3Trait<T> {
fn items_3_trait_function(self, x: T) -> u64;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
library;

pub use ::items_4_1::*;
pub use ::items_4_1::Items4_Variants::*;

pub use ::items_4_2::Items4_Struct;
pub use ::items_4_2::Items4_Enum;
pub use ::items_4_2::Items4_Variants;
pub use ::items_4_2::Items4_Variants::K;
pub use ::items_4_2::Items4_Variants::L;
pub use ::items_4_2::ITEMS_4_FUNCTION_RES;
pub use ::items_4_2::items_4_function;
pub use ::items_4_2::Items4Trait;

pub use ::items_4_3::Items4_Variants2::*;
pub use ::items_4_4::Items4_Variants2::M;
pub use ::items_4_4::Items4_Variants2::N;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
script;

mod items_1;
mod lib_1; // Item reexports of items_1
mod items_2_1;
mod items_2_2;
mod lib_2; // Item reexports of items_2_1 and items_2_2
mod items_3_1;
mod lib_3; // Item reexports of items_3_1 and items_3_2
mod items_4_1;
mod items_4_2;
mod items_4_3;
mod items_4_4;
mod lib_4; // Item reexports of items_4_1 and items_4_2

mod tests; // All tests

fn main() -> u64 {
tests::run_all_tests()
}
Loading

0 comments on commit ff008ea

Please sign in to comment.