Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ path = "module/move/llm_tools"

[workspace.dependencies.benchkit]
version = "~0.9.0"
path = "module/move/benchkit"
path = "module/core/benchkit"

## steps

Expand Down
10 changes: 5 additions & 5 deletions module/alias/winterval/examples/winterval_non_iterable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
fn main() {
use winterval::{NonIterableInterval, IntoInterval, Bound};

fn f1(interval: impl NonIterableInterval) {
fn f1(interval: &impl NonIterableInterval) {
println!(
"Do something with this {:?} .. {:?} interval",
interval.left(),
Expand All @@ -12,12 +12,12 @@ fn main() {
}

// Iterable/bound interval from tuple.
f1((Bound::Included(0), Bound::Included(3)).into_interval());
f1(&(Bound::Included(0), Bound::Included(3)).into_interval());
// Non-iterable/unbound interval from tuple.
f1((Bound::Included(0), Bound::Unbounded).into_interval());
f1(&(Bound::Included(0), Bound::Unbounded).into_interval());
// Non-iterable/unbound interval from `core::ops::RangeFrom`.
f1(0..);
f1(&(0..));
// Non-iterable/unbound interval from `core::ops::RangeFull`
// what is ( -Infinity .. +Infinity ).
f1(..);
f1(&(..));
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ authors = [
license = "MIT"
readme = "readme.md"
documentation = "https://docs.rs/benchkit"
repository = "https://github.com/Wandalen/wTools/tree/master/module/move/benchkit"
homepage = "https://github.com/Wandalen/wTools/tree/master/module/move/benchkit"
repository = "https://github.com/Wandalen/wTools/tree/master/module/core/benchkit"
homepage = "https://github.com/Wandalen/wTools/tree/master/module/core/benchkit"
description = """
Lightweight benchmarking toolkit focused on practical performance analysis and report generation.
Non-restrictive alternative to criterion, designed for easy integration and markdown report generation.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions module/core/clone_dyn/tests/inc/basic_manual.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[ allow( unused_imports ) ]
use super::*;
#[ allow( unused_imports ) ]
use test_tools::a_id;

trait Trait1
where
Expand Down
49 changes: 26 additions & 23 deletions module/core/clone_dyn/tests/inc/only_test/basic.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

#[ allow( unused_imports ) ]
use super::*;

// ## Test Matrix for `only_test/basic.rs`
//
// This file contains basic tests for `clone_into_box` and `clone` functions.
Expand All @@ -17,26 +20,26 @@ fn clone_into_box()
// copyable

let a : i32 = 13;
let b : Box< i32 > = the_module::clone_into_box( &a );
a_id!( a, *b );
let b : Box< i32 > = the_module::clone_into_box( &a );
assert_eq!( a, *b );

// clonable

let a : String = "abc".to_string();
let b : Box< String > = the_module::clone_into_box( &a );
a_id!( a, *b );
let b : Box< String > = the_module::clone_into_box( &a );
assert_eq!( a, *b );

// str slice

let a : &str = "abc";
let b : Box< str > = the_module::clone_into_box( a );
a_id!( *a, *b );
let b : Box< str > = the_module::clone_into_box( a );
assert_eq!( *a, *b );

// slice

let a : &[ i32 ] = &[ 1, 2, 3 ];
let b : Box< [ i32 ] > = the_module::clone_into_box( a );
a_id!( *a, *b );
let b : Box< [ i32 ] > = the_module::clone_into_box( a );
assert_eq!( *a, *b );

//

Expand All @@ -50,25 +53,25 @@ fn clone()

let a : i32 = 13;
let b : i32 = the_module::clone( &a );
a_id!( a, b );
assert_eq!( a, b );

// clonable

let a : String = "abc".to_string();
let b : String = the_module::clone( &a );
a_id!( a, b );
assert_eq!( a, b );

// str slice

let a : &str = "abc";
let b : &str = the_module::clone( &a );
a_id!( a, b );
assert_eq!( a, b );

// slice

let a : &[ i32 ] = &[ 1, 2, 3 ];
let b : &[ i32 ] = the_module::clone( &a );
a_id!( a, b );
assert_eq!( a, b );

//

Expand All @@ -80,34 +83,34 @@ fn basic()

//

let e_i32 : Box< dyn Trait1 > = Box::new( 13 );
let e_i64 : Box< dyn Trait1 > = Box::new( 14 );
let e_string : Box< dyn Trait1 > = Box::new( "abc".to_string() );
let e_str_slice : Box< dyn Trait1 > = Box::new( "abcd" );
let e_slice : Box< dyn Trait1 > = Box::new( &[ 1i32, 2i32 ] as &[ i32 ] );
let e_i32 : Box< dyn Trait1 > = Box::new( 13 );
let e_i64 : Box< dyn Trait1 > = Box::new( 14 );
let e_string : Box< dyn Trait1 > = Box::new( "abc".to_string() );
let e_str_slice : Box< dyn Trait1 > = Box::new( "abcd" );
let e_slice : Box< dyn Trait1 > = Box::new( &[ 1i32, 2i32 ] as &[ i32 ] );

//

let vec : Vec< Box< dyn Trait1 > > = vec![ e_i32.clone(), e_i64.clone(), e_string.clone(), e_str_slice.clone(), e_slice.clone() ];
let vec : Vec< Box< dyn Trait1 > > = vec![ e_i32.clone(), e_i64.clone(), e_string.clone(), e_str_slice.clone(), e_slice.clone() ];
let vec = vec.iter().map( | e | e.val() ).collect::< Vec< _ > >();
let vec2 = vec![ 13, 14, 3, 4, 2 ];
a_id!( vec, vec2 );
assert_eq!( vec, vec2 );

//

let vec : Vec< Box< dyn Trait1 > > = vec![ e_i32.clone(), e_i64.clone(), e_string.clone(), e_str_slice.clone(), e_slice.clone() ];
let vec : Vec< Box< dyn Trait1 > > = vec![ e_i32.clone(), e_i64.clone(), e_string.clone(), e_str_slice.clone(), e_slice.clone() ];
let vec2 = the_module::clone( &vec );
let vec = vec.iter().map( | e | e.val() ).collect::< Vec< _ > >();
let vec2 = vec2.iter().map( | e | e.val() ).collect::< Vec< _ > >();
a_id!( vec, vec2 );
assert_eq!( vec, vec2 );

//

let vec : Vec< Box< dyn Trait1 > > = vec![ e_i32.clone(), e_i64.clone(), e_string.clone(), e_str_slice.clone(), e_slice.clone() ];
let vec : Vec< Box< dyn Trait1 > > = vec![ e_i32.clone(), e_i64.clone(), e_string.clone(), e_str_slice.clone(), e_slice.clone() ];
let vec2 = vec.clone();
let vec = vec.iter().map( | e | e.val() ).collect::< Vec< _ > >();
let vec2 = vec2.iter().map( | e | e.val() ).collect::< Vec< _ > >();
a_id!( vec, vec2 );
assert_eq!( vec, vec2 );

//

Expand Down
6 changes: 3 additions & 3 deletions module/core/clone_dyn/tests/inc/parametrized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ fn basic() {
"\"abcd\"".to_string(),
"[1, 2]".to_string(),
];
a_id!(vec, vec2);
assert_eq!(vec, vec2);

//

Expand All @@ -112,7 +112,7 @@ fn basic() {
let vec2 = the_module::clone(&vec);
let vec = vec.iter().map(|e| e.dbg()).collect::<Vec<_>>();
let vec2 = vec2.iter().map(|e| e.dbg()).collect::<Vec<_>>();
a_id!(vec, vec2);
assert_eq!(vec, vec2);

//

Expand All @@ -126,7 +126,7 @@ fn basic() {
let vec2 = vec.clone();
let vec = vec.iter().map(|e| e.dbg()).collect::<Vec<_>>();
let vec2 = vec2.iter().map(|e| e.dbg()).collect::<Vec<_>>();
a_id!(vec, vec2);
assert_eq!(vec, vec2);

//
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn main() {
}
}

let mut got: Person = Default::default();
let mut got: Person = Person::default();
got.assign(13);
got.assign("John");
assert_eq!(
Expand Down
4 changes: 2 additions & 2 deletions module/core/component_model_types/tests/inc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ mod components_tests {
#[ cfg( feature = "types_component_assign" ) ]
mod component_assign_manual;

#[cfg(all(feature = "types_component_assign"))]
#[cfg(feature = "types_component_assign")]
mod components_assign_manual;

// #[ cfg( all( feature = "derive_from_components" ) ) ]
mod from_components_manual;

#[cfg(all(feature = "types_component_assign"))]
#[cfg(feature = "types_component_assign")]
mod composite_manual;
}
4 changes: 2 additions & 2 deletions module/core/data_type/tests/smoke_test.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//! Smoke testing of the package.

#[ ignore ]
#[ ignore = "temporarily disabled due to test_tools::test module gating issues" ]
#[ test ]
fn local_smoke_test() {
// xxx: temporarily disabled due to test_tools::test module gating issues
}

#[ ignore ]
#[ ignore = "temporarily disabled due to test_tools::test module gating issues" ]
#[ test ]
fn published_smoke_test() {
// xxx: temporarily disabled due to test_tools::test module gating issues
Expand Down
35 changes: 12 additions & 23 deletions module/core/derive_tools/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,30 @@
<!-- {{# generate.module{} #}} -->

```rust
# #[ cfg( all( feature = "derive_from", feature = "derive_inner_from", feature = "derive_display", feature = "derive_from_str" ) ) ]
# #[ cfg( all( feature = "derive_from", feature = "derive_display", feature = "derive_from_str" ) ) ]
{
use derive_tools::*;

#[ derive( From, InnerFrom, Display, FromStr, PartialEq, Debug ) ]
#[ display( "{a}-{b}" ) ]
struct Struct1
{
a : i32,
b : i32,
}

// derived InnerFrom
let src = Struct1 { a : 1, b : 3 };
let got : ( i32, i32 ) = src.into();
let exp = ( 1, 3 );
assert_eq!( got, exp );
#[ derive( From, Display, FromStr, PartialEq, Debug ) ]
#[ display( "{0}" ) ]
struct Struct1( i32 );

// derived From
let src : Struct1 = ( 1, 3 ).into();
let got : ( i32, i32 ) = src.into();
let exp = ( 1, 3 );
assert_eq!( got, exp );
let src : Struct1 = 42.into();
let exp = Struct1( 42 );
assert_eq!( src, exp );

// derived Display
let src = Struct1 { a : 1, b : 3 };
let src = Struct1( 42 );
let got = format!( "{}", src );
let exp = "1-3";
let exp = "42";
println!( "{}", got );
assert_eq!( got, exp );

// derived FromStr
// derived FromStr
use std::str::FromStr;
let src = Struct1::from_str( "1-3" );
let exp = Ok( Struct1 { a : 1, b : 3 } );
let src = Struct1::from_str( "42" );
let exp = Ok( Struct1( 42 ) );
assert_eq!( src, exp );

}
Expand Down
1 change: 1 addition & 0 deletions module/core/derive_tools/tests/inc/as_ref_manual_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use super::*;
// use derives::*;

#[ derive( Debug, Clone, Copy, PartialEq ) ]
#[ allow( dead_code ) ]
pub struct IsTransparent(bool);

impl AsRef<bool> for IsTransparent {
Expand Down
1 change: 1 addition & 0 deletions module/core/derive_tools/tests/inc/as_ref_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use super::*;
// use derives::*;

#[ derive( Debug, Clone, Copy, PartialEq, the_module::AsRef ) ]
#[ allow( dead_code ) ]
pub struct IsTransparent(bool);

include!("./only_test/as_ref.rs");
15 changes: 8 additions & 7 deletions module/core/derive_tools/tests/inc/deref/basic_manual_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use super::*;
// use derives::*;

#[ derive( Debug, Clone, Copy, PartialEq ) ]
#[ allow( dead_code ) ]
pub struct IsTransparentSimple(bool);

impl core::ops::Deref for IsTransparentSimple {
Expand Down Expand Up @@ -39,13 +40,13 @@ use test_tools::a_id;
#[ test ]
fn deref_test() {
// Test for IsTransparentSimple
let got = IsTransparentSimple(true);
let exp = true;
a_id!(*got, exp);
a_id!(*IsTransparentSimple(true), true);

// Test for IsTransparentComplex
let got_tmp = "hello".to_string();
let got = IsTransparentComplex::<'_, '_, String, str, 0>(&got_tmp, core::marker::PhantomData);
let exp = &got_tmp;
a_id!(*got, exp);
#[ allow( clippy::no_effect_underscore_binding ) ]
{
let got_tmp = "hello".to_string();
let _got = IsTransparentComplex::<'_, '_, String, str, 0>(&got_tmp, core::marker::PhantomData);
a_id!(*_got, &got_tmp);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@ impl core::ops::DerefMut for IsTransparentSimple {
#[ test ]
fn deref_mut_test() {
// Test for IsTransparentSimple
let mut got = IsTransparentSimple(true);
let exp = true;
a_id!(*got, exp);
*got = false;
a_id!(*got, false);
let mut _got = IsTransparentSimple(true);
a_id!(*_got, true);
*_got = false;
a_id!(*_got, false);

// Test for IsTransparentComplex (commented out due to const generics issue)
// let mut got_tmp = "hello".to_string();
Expand Down
9 changes: 4 additions & 5 deletions module/core/derive_tools/tests/inc/deref_mut/basic_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ pub struct IsTransparentSimple(bool);
#[ test ]
fn deref_mut_test() {
// Test for IsTransparentSimple
let mut got = IsTransparentSimple(true);
let exp = true;
a_id!(*got, exp);
*got = false;
a_id!(*got, false);
let mut _got = IsTransparentSimple(true);
a_id!(*_got, true);
*_got = false;
a_id!(*_got, false);

// Test for IsTransparentComplex (commented out due to const generics issue)
// let mut got_tmp = "hello".to_string();
Expand Down
11 changes: 4 additions & 7 deletions module/core/derive_tools/tests/inc/from/basic_manual_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use super::*;
use test_tools::a_id;

#[ derive( Debug, Clone, Copy, PartialEq ) ]
#[ allow( dead_code ) ]
pub struct IsTransparentSimple(bool);

impl From<bool> for IsTransparentSimple {
Expand Down Expand Up @@ -40,13 +41,9 @@ where
#[ test ]
fn from_test() {
// Test for IsTransparentSimple
let got = IsTransparentSimple::from(true);
let exp = IsTransparentSimple(true);
a_id!(got, exp);
a_id!(IsTransparentSimple::from(true), IsTransparentSimple(true));

// Test for IsTransparentComplex
let got_tmp = "hello".to_string();
let got = IsTransparentComplex::<'_, '_, String, str, 0>::from(&got_tmp);
let exp = IsTransparentComplex::<'_, '_, String, str, 0>(&got_tmp, core::marker::PhantomData);
a_id!(got, exp);
let _got_tmp = "hello".to_string();
a_id!(IsTransparentComplex::<'_, '_, String, str, 0>::from(&_got_tmp), IsTransparentComplex::<'_, '_, String, str, 0>(&_got_tmp, core::marker::PhantomData));
}
Loading