<commit_before>#[ allow( unused_imports ) ]
use super::TheModule;
use test_tools::*;
use TheModule::*;

tests_impls!
{

  //

  #[ test ]
  fn basic_test()
  {

    mod mod1
    {
      pub use f32;
      pub use f64;
    }

    // trace_macros!( true );
    types!
    {

      ///
      /// Attribute which is inner.
      ///

      #[ derive( Debug, Clone ) ]
      #[ derive( PartialEq ) ]
      pair Pair : mod1::f32, mod1::f64;

    }
    // trace_macros!( false );

    trait Round { fn round( &self ) -> Self; };
    impl Round for Pair
    {
      fn round( &self ) -> Self
      {
        Pair( self.0.round(), self.1.round() )
      }
    }

    /* test.case( "from f32 / into Pair" ) */
    let instance1 : Pair = ( 13.0, 31.0 ).into();
    let instance2 = Pair::from( ( 13.0, 31.0 ) );
    assert_eq!( instance1.0, 13.0 );
    assert_eq!( instance1.1, 31.0 );
    assert_eq!( instance2.0, 13.0 );
    assert_eq!( instance2.1, 31.0 );
    assert_eq!( instance1, instance2 );

    /* test.case( "from itself / into itself" ) */
    let instance1 : Pair = ( Pair::from( ( 13.0, 31.0 ) ) ).into();
    let instance2 = Pair::from( Pair::from( ( 13.0, 31.0 ) ) );
    assert_eq!( instance1.0, 13.0 );
    assert_eq!( instance1.1, 31.0 );
    assert_eq!( instance2.0, 13.0 );
    assert_eq!( instance2.1, 31.0 );
    assert_eq!( instance1, instance2 );

    /* test.case( "clone / eq" ) */
    let instance1 : Pair = ( 13.0, 31.0 ).into();
    let instance2 = instance1.clone();
    assert_eq!( instance2.0, 13.0 );
    assert_eq!( instance2.1, 31.0 );
    assert_eq!( instance1, instance2 );

    /* test.case( "deref" ) */
    let got : Pair = ( 13.5, 31.5 ).into();
    assert_eq!( got.round(), Pair( 14.0, 32.0 ) );

  }

  //

  #[ test ]
  fn empty_parameter_test()
  {

    mod mod1
    {
      pub use f32;
      pub use f64;
    }

    // trace_macros!( true );
    types!
    {

      ///
      /// Attribute which is inner.
      ///

      #[ derive( Debug, Clone ) ]
      #[ derive( PartialEq ) ]
      pair Pair : mod1::f32<>, mod1::f64<>;

    }
    // trace_macros!( false );

    trait Round { fn round( &self ) -> Self; };
    impl Round for Pair
    {
      fn round( &self ) -> Self
      {
        Pair( self.0.round(), self.1.round() )
      }
    }

    /* test.case( "from f32 / into Pair" ) */
    let instance1 : Pair = ( 13.0, 31.0 ).into();
    let instance2 = Pair::from( ( 13.0, 31.0 ) );
    assert_eq!( instance1.0, 13.0 );
    assert_eq!( instance1.1, 31.0 );
    assert_eq!( instance2.0, 13.0 );
    assert_eq!( instance2.1, 31.0 );
    assert_eq!( instance1, instance2 );

    /* test.case( "from itself / into itself" ) */
    let instance1 : Pair = ( Pair::from( ( 13.0, 31.0 ) ) ).into();
    let instance2 = Pair::from( Pair::from( ( 13.0, 31.0 ) ) );
    assert_eq!( instance1.0, 13.0 );
    assert_eq!( instance1.1, 31.0 );
    assert_eq!( instance2.0, 13.0 );
    assert_eq!( instance2.1, 31.0 );
    assert_eq!( instance1, instance2 );

    /* test.case( "clone / eq" ) */
    let instance1 : Pair = ( 13.0, 31.0 ).into();
    let instance2 = instance1.clone();
    assert_eq!( instance2.0, 13.0 );
    assert_eq!( instance2.1, 31.0 );
    assert_eq!( instance1, instance2 );

    /* test.case( "deref" ) */
    let got : Pair = ( 13.5, 31.5 ).into();
    assert_eq!( got.round(), Pair( 14.0, 32.0 ) );

  }

  //

  #[ test ]
  fn parametrized_multiple_test()
  {

    mod mod1
    {

      #[ derive( Debug, Clone, PartialEq ) ]
      pub struct Pair0< T1 : PartialEq + Copy, T2 : Default >
      (
        pub T1,
        pub T2,
      );

      impl< T1 : PartialEq + Copy, T2 : Default > core::ops::Deref
      for Pair0< T1, T2 >
      {
        type Target = T1;
        fn deref( &self ) -> &Self::Target
        {
          &self.0
        }
      }

      impl< T1 : PartialEq + Copy, T2 : Default > From< T1 >
      for Pair0< T1, T2 >
      {
        fn from( src : T1 ) -> Self
        {
          Pair0::< T1, T2 >( src, T2::default() )
        }
      }

    }

//     types!
//     {
//
//       ///
//       /// Attribute which is inner.
//       ///
//
//       #[ derive( Debug, Clone ) ]
//       #[ derive( PartialEq ) ]
//       pair Pair : mod1::Pair0< T1 : PartialEq + std::marker::Copy, T2 : Default >;
//
//     }

//     /* test.case( "from f32 / into Pair" ) */
//     let instance1 : Pair< f32, f64 > = ( mod1::Pair0::from( ( 13.0, 31.0 ) ) ).into();
//     let instance2 = Pair::< f32, f64 >::from( mod1::Pair0::from( ( 13.0, 31.0 ) ) );
//     assert_eq!( instance1.0.0, 13.0 );
//     assert_eq!( instance2.0.0, 13.0 );
//     assert_eq!( instance1, instance2 );
//
//     /* test.case( "from itself / into itself" ) */
//     let instance1 : Pair< f32, f64 > = ( Pair::from( mod1::Pair0::from( ( 13.0, 31.0 ) ) ) ).into();
//     let instance2 = Pair::< f32, f64 >::from( Pair::from( mod1::Pair0::from( ( 13.0, 31.0 ) ) ) );
//     assert_eq!( instance1.0.0, 13.0 );
//     assert_eq!( instance2.0.0, 13.0 );
//     assert_eq!( instance1, instance2 );
//
//     /* test.case( "from Pair / into f32" ) */<commit_msg>!build<commit_after>#[ allow( unused_imports ) ]
use super::TheModule;
use test_tools::*;
use TheModule::*;

tests_impls!
{

  //

  #[ test ]
  fn basic_test()
  {

    mod mod1
    {
      pub use f32;
      pub use f64;
    }

    // trace_macros!( true );
    types!
    {

      ///
      /// Attribute which is inner.
      ///

      #[ derive( Debug, Clone ) ]
      #[ derive( PartialEq ) ]
      pair Pair : mod1::f32, mod1::f64;

    }
    // trace_macros!( false );

    trait Round { fn round( &self ) -> Self; };
    impl Round for Pair
    {
      fn round( &self ) -> Self
      {
        Pair( self.0.round(), self.1.round() )
      }
    }

    /* test.case( "from f32 / into Pair" ) */
    let instance1 : Pair = ( 13.0, 31.0 ).into();
    let instance2 = Pair::from( ( 13.0, 31.0 ) );
    assert_eq!( instance1.0, 13.0 );
    assert_eq!( instance1.1, 31.0 );
    assert_eq!( instance2.0, 13.0 );
    assert_eq!( instance2.1, 31.0 );
    assert_eq!( instance1, instance2 );

    /* test.case( "from itself / into itself" ) */
    let instance1 : Pair = ( Pair::from( ( 13.0, 31.0 ) ) ).into();
    let instance2 = Pair::from( Pair::from( ( 13.0, 31.0 ) ) );
    assert_eq!( instance1.0, 13.0 );
    assert_eq!( instance1.1, 31.0 );
    assert_eq!( instance2.0, 13.0 );
    assert_eq!( instance2.1, 31.0 );
    assert_eq!( instance1, instance2 );

    /* test.case( "clone / eq" ) */
    let instance1 : Pair = ( 13.0, 31.0 ).into();
    let instance2 = instance1.clone();
    assert_eq!( instance2.0, 13.0 );
    assert_eq!( instance2.1, 31.0 );
    assert_eq!( instance1, instance2 );

    /* test.case( "deref" ) */
    let got : Pair = ( 13.5, 31.5 ).into();
    assert_eq!( got.round(), Pair( 14.0, 32.0 ) );

  }

  //

  #[ test ]
  fn empty_parameter_test()
  {

    mod mod1
    {
      pub use f32;
      pub use f64;
    }

    // trace_macros!( true );
    types!
    {

      ///
      /// Attribute which is inner.
      ///

      #[ derive( Debug, Clone ) ]
      #[ derive( PartialEq ) ]
      pair Pair : mod1::f32<>, mod1::f64<>;

    }
    // trace_macros!( false );

    trait Round { fn round( &self ) -> Self; };
    impl Round for Pair
    {
      fn round( &self ) -> Self
      {
        Pair( self.0.round(), self.1.round() )
      }
    }

    /* test.case( "from f32 / into Pair" ) */
    let instance1 : Pair = ( 13.0, 31.0 ).into();
    let instance2 = Pair::from( ( 13.0, 31.0 ) );
    assert_eq!( instance1.0, 13.0 );
    assert_eq!( instance1.1, 31.0 );
    assert_eq!( instance2.0, 13.0 );
    assert_eq!( instance2.1, 31.0 );
    assert_eq!( instance1, instance2 );

    /* test.case( "from itself / into itself" ) */
    let instance1 : Pair = ( Pair::from( ( 13.0, 31.0 ) ) ).into();
    let instance2 = Pair::from( Pair::from( ( 13.0, 31.0 ) ) );
    assert_eq!( instance1.0, 13.0 );
    assert_eq!( instance1.1, 31.0 );
    assert_eq!( instance2.0, 13.0 );
    assert_eq!( instance2.1, 31.0 );
    assert_eq!( instance1, instance2 );

    /* test.case( "clone / eq" ) */
    let instance1 : Pair = ( 13.0, 31.0 ).into();
    let instance2 = instance1.clone();
    assert_eq!( instance2.0, 13.0 );
    assert_eq!( instance2.1, 31.0 );
    assert_eq!( instance1, instance2 );

    /* test.case( "deref" ) */
    let got : Pair = ( 13.5, 31.5 ).into();
    assert_eq!( got.round(), Pair( 14.0, 32.0 ) );

  }

  //

  #[ test ]
  fn parametrized_multiple_test()
  {

    mod mod1
    {

      #[ derive( Debug, Clone, PartialEq ) ]
      pub struct Pair0< T1 : PartialEq + Copy, T2 : Default >
      (
        pub T1,
        pub T2,
      );

      impl< T1 : PartialEq + Copy, T2 : Default > core::ops::Deref
      for Pair0< T1, T2 >
      {
        type Target = T1;
        fn deref( &self ) -> &Self::Target
        {
          &self.0
        }
      }

      impl< T1 : PartialEq + Copy, T2 : Default > From< T1 >
      for Pair0< T1, T2 >
      {
        fn from( src : T1 ) -> Self
        {
          Pair0::< T1, T2 >( src, T2::default() )
        }
      }

    }


//     types!
//     {
//
//       ///
//       /// Attribute which is inner.
//       ///
//
//       #[ derive( Debug, Clone ) ]
//       #[ derive( PartialEq ) ]
//       pair Pair : mod1::Pair0< T1 : PartialEq + std::marker::Copy, T2 : Default >;
//
//     }

//     /* test.case( "from f32 / into Pair" ) */
//     let instance1 : Pair< f32, f64 > = ( mod1::Pair0::from( ( 13.0, 31.0 ) ) ).into();
//     let instance2 = Pair::< f32, f64 >::from( mod1::Pair0::from( ( 13.0, 31.0 ) ) );
//     assert_eq!( instance1.0.0, 13.0 );
//     assert_eq!( instance2.0.0, 13.0 );
//     assert_eq!( instance1, instance2 );
//
//     /* test.case( "from itself / into itself" ) */
//     let instance1 : Pair< f32, f64 > = ( Pair::from( mod1::Pair0::from( ( 13.0, 31.0 ) ) ) ).into();
//     let instance2 = Pair::< f32, f64 >::from( Pair::from( mod1::Pair0::from( ( 13.0, 31.0 ) ) ) );
//     assert_eq!( instance1.0.0, 13.0 );
//     assert_eq!( instance2.0.0, 13.0 );
//     assert_eq!( instance1, instance2 );
//
//     /* test.case( "from Pair / into f32" ) */
{'fraction_non_alphanumeric': 0.19240580847723704, 'fraction_numerical': 0.06907378335949764, 'mean_word_length': 1.831388888888889, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7383776', 'n_tokens_mistral': 4189, 'n_tokens_neox': 3781, 'n_words': 898}