Skip to content

Commit 9beca47

Browse files
committed
test_tools : standalone mem_tools
1 parent 4c17fa5 commit 9beca47

File tree

11 files changed

+71
-29
lines changed

11 files changed

+71
-29
lines changed

module/core/diagnostics_tools/src/diag/rta.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,4 +289,3 @@ pub mod prelude
289289
};
290290

291291
}
292-

module/core/diagnostics_tools/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ pub mod own
3131
#[ doc( inline ) ]
3232
pub use orphan::*;
3333
#[ doc( inline ) ]
34-
#[ allow( unused_imports ) ]
3534
pub use super::diag::orphan::*;
3635
}
3736

@@ -54,7 +53,6 @@ pub mod exposed
5453
#[ doc( inline ) ]
5554
pub use prelude::*;
5655
#[ doc( inline ) ]
57-
#[ allow( unused_imports ) ]
5856
pub use super::diag::exposed::*;
5957
}
6058

@@ -65,6 +63,5 @@ pub mod prelude
6563
{
6664
use super::*;
6765
#[ doc( inline ) ]
68-
#[ allow( unused_imports ) ]
6966
pub use super::diag::prelude::*;
7067
}

module/core/mem_tools/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ workspace = true
2424
features = [ "full" ]
2525
all-features = false
2626

27-
2827
include = [
2928
"/rust/impl/mem",
3029
"/Cargo.toml",

module/core/mem_tools/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ pub mod own
3737
#[ doc( inline ) ]
3838
pub use orphan::*;
3939
#[ doc( inline ) ]
40-
#[ allow( unused_imports ) ]
4140
pub use super::mem::orphan::*;
4241
}
4342

@@ -60,7 +59,6 @@ pub mod exposed
6059
#[ doc( inline ) ]
6160
pub use prelude::*;
6261
#[ doc( inline ) ]
63-
#[ allow( unused_imports ) ]
6462
pub use super::mem::exposed::*;
6563
}
6664

@@ -71,6 +69,5 @@ pub mod prelude
7169
{
7270
use super::*;
7371
#[ doc( inline ) ]
74-
#[ allow( unused_imports ) ]
7572
pub use super::mem::prelude::*;
7673
}

module/core/mem_tools/src/mem.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,30 +64,28 @@ mod private
6464

6565
}
6666

67+
#[ doc( inline ) ]
68+
#[ allow( unused_imports ) ]
69+
pub use own::*;
70+
6771
/// Own namespace of the module.
6872
#[ allow( unused_imports ) ]
6973
pub mod own
7074
{
7175
use super::*;
7276
#[ doc( inline ) ]
73-
#[ allow( unused_imports ) ]
7477
pub use super::
7578
{
7679
orphan::*,
7780
};
7881
}
7982

80-
#[ doc( inline ) ]
81-
#[ allow( unused_imports ) ]
82-
pub use own::*;
83-
8483
/// Orphan namespace of the module.
8584
#[ allow( unused_imports ) ]
8685
pub mod orphan
8786
{
8887
use super::*;
8988
#[ doc( inline ) ]
90-
#[ allow( unused_imports ) ]
9189
pub use super::
9290
{
9391
exposed::*,
@@ -103,6 +101,9 @@ pub mod orphan
103101
pub mod exposed
104102
{
105103
use super::*;
104+
// Expose itself.
105+
pub use super::super::mem;
106+
106107
#[ doc( inline ) ]
107108
pub use prelude::*;
108109
}

module/core/test_tools/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ standalone = [
8080
"standalone_collection_tools",
8181
"standalone_impls_index",
8282
"standalone_mem_tools",
83-
"dep:mem_tools",
83+
# "dep:mem_tools",
8484
"dep:typing_tools",
8585
"dep:diagnostics_tools",
8686
"dep:process_tools",
@@ -112,8 +112,8 @@ rand = { workspace = true }
112112
error_tools = { workspace = true, features = [ "full" ], optional = true }
113113
collection_tools = { workspace = true, features = [ "full" ], optional = true }
114114
impls_index = { workspace = true, features = [ "full" ], optional = true }
115-
116115
mem_tools = { workspace = true, features = [ "full" ], optional = true }
116+
117117
typing_tools = { workspace = true, features = [ "full" ], optional = true }
118118
diagnostics_tools = { workspace = true, features = [ "full" ], optional = true }
119119
process_tools = { workspace = true, features = [ "full" ], optional = true }
@@ -129,7 +129,6 @@ thiserror = { workspace = true, optional = true }
129129
hashbrown = { workspace = true, optional = true }
130130
# impls_index
131131
impls_index_meta = { workspace = true, optional = true }
132-
# mem_tools
133132

134133
[build-dependencies]
135134
rustc_version = "0.4"

module/core/test_tools/src/lib.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,16 @@ mod standalone
112112
pub mod collection;
113113
pub use collection as collection_tools;
114114

115-
/// impl index macroc.
115+
/// impl and index macros.
116116
#[ path = "../../../../core/impls_index/src/impls_index/mod.rs" ]
117117
pub mod impls_index;
118118

119+
/// Memory tools.
120+
#[ path = "../../../../core/mem_tools/src/mem.rs" ]
121+
pub mod mem_tools;
122+
119123
}
124+
120125
#[ cfg( feature = "enabled" ) ]
121126
#[ cfg( feature = "standalone" ) ]
122127
pub use standalone::*;
@@ -128,12 +133,12 @@ pub use ::
128133
error_tools,
129134
collection_tools,
130135
impls_index,
136+
mem_tools,
131137
};
132138

133139
#[ cfg( feature = "enabled" ) ]
134140
pub use ::
135141
{
136-
mem_tools,
137142
typing_tools,
138143
diagnostics_tools,
139144
process_tools,
@@ -162,7 +167,7 @@ pub mod own
162167
{
163168
error_tools::orphan::*,
164169
collection_tools::orphan::*,
165-
// meta_tools::orphan::*,
170+
impls_index::orphan::*,
166171
mem_tools::orphan::*,
167172
typing_tools::orphan::*,
168173
diagnostics_tools::orphan::*,
@@ -203,7 +208,7 @@ pub mod exposed
203208
{
204209
error_tools::exposed::*,
205210
collection_tools::exposed::*,
206-
// meta_tools::exposed::*,
211+
impls_index::exposed::*,
207212
mem_tools::exposed::*,
208213
typing_tools::exposed::*,
209214
diagnostics_tools::exposed::*,
@@ -226,7 +231,7 @@ pub mod prelude
226231
{
227232
error_tools::prelude::*,
228233
collection_tools::prelude::*,
229-
// meta_tools::prelude::*,
234+
impls_index::prelude::*,
230235
mem_tools::prelude::*,
231236
typing_tools::prelude::*,
232237
diagnostics_tools::prelude::*,
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
use super::*;
2+
3+
//
4+
5+
#[ allow( dead_code ) ]
6+
#[ test ]
7+
fn same_data()
8+
{
9+
let buf = [ 0u8; 128 ];
10+
assert!( the_module::mem::same_data( &buf, &buf ) );
11+
12+
let x = [ 0u8; 1 ];
13+
let y = 0u8;
14+
15+
assert!( the_module::mem::same_data( &x, &y ) );
16+
17+
assert!( !the_module::mem::same_data( &buf, &x ) );
18+
assert!( !the_module::mem::same_data( &buf, &y ) );
19+
20+
struct H1( &'static str );
21+
struct H2( &'static str );
22+
23+
assert!( the_module::mem::same_data( &H1( "hello" ), &H2( "hello" ) ) );
24+
assert!( !the_module::mem::same_data( &H1( "qwerty" ), &H2( "hello" ) ) );
25+
26+
}
Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
1-
#[ allow( unused_imports ) ]
21
use super::*;
32

4-
mod basic_test;
3+
mod impls_index_test;
4+
mod mem_test;
55
mod try_build_test;
66
// mod wtest_utility;
77

88
// qqq : include tests of all internal dependencies
9+
10+
// /// Error tools.
11+
// #[ path = "../../../../core/error_tools/tests/inc/mod.rs" ]
12+
// pub mod error;
13+
// pub use error as error_tools;
14+
//
15+
// /// Collection tools.
16+
// #[ path = "../../../../core/collection_tools/tests/inc/mod.rs" ]
17+
// pub mod collection;
18+
// pub use collection as collection_tools;
19+
20+
// /// impl and index macros.
21+
// #[ path = "../../../../core/impls_index/tests/inc/mod.rs" ]
22+
// pub mod impls_index;
23+
24+
// /// Memory tools.
25+
// #[ path = "../../../../core/mem_tools/tests/inc/mod.rs" ]
26+
// pub mod mem_tools;

0 commit comments

Comments
 (0)