
use super::*;

//

tests_impls!
{
  fn basic_no_args()
  {
    let path = std::ffi::OsStr::new( "../../../target/debug/wpublisher" );
    let proc = std::process::Command::new( path ).output().unwrap();
    assert!( !proc.status.success() );
    let stdout = std::str::from_utf8( proc.stdout.as_slice() ).unwrap();
    assert!( stdout.contains( "Illformed command" ) );
    assert!( stdout.contains( ".list - List packages." ) );
  }

  //

  fn basic_with_args()
  {
    let path = std::ffi::OsStr::new( "../../../target/debug/wpublisher" );
    let proc = std::process::Command::new( path ).arg( ".list" ).output().unwrap();
    assert!( proc.status.success() );
    let stdout = std::str::from_utf8( proc.stdout.as_slice() ).unwrap();
    assert_eq!( stdout, "" );
    let stderr = std::str::from_utf8( proc.stderr.as_slice() ).unwrap();
    assert_eq!( stderr, "" );
  }
}

//

tests_index!
{
  basic_no_args,
  basic_with_args,
}


use super::*;

//

tests_impls!
{
  #[ test ]
  fn basic()
  {
    /* qqq : write tests for modules of wpublisher */
    a_id!( true, true );
  }
}

//

tests_index!
{
  basic,
}

--- 
+++ 
@@ -5,11 +5,27 @@
 
 tests_impls!
 {
-  #[ test ]
-  fn basic()
+  fn basic_no_args()
   {
-    /* qqq : write tests for modules of wpublisher */
-    a_id!( true, true );
+    let path = std::ffi::OsStr::new( "../../../target/debug/wpublisher" );
+    let proc = std::process::Command::new( path ).output().unwrap();
+    assert!( !proc.status.success() );
+    let stdout = std::str::from_utf8( proc.stdout.as_slice() ).unwrap();
+    assert!( stdout.contains( "Illformed command" ) );
+    assert!( stdout.contains( ".list - List packages." ) );
+  }
+
+  //
+
+  fn basic_with_args()
+  {
+    let path = std::ffi::OsStr::new( "../../../target/debug/wpublisher" );
+    let proc = std::process::Command::new( path ).arg( ".list" ).output().unwrap();
+    assert!( proc.status.success() );
+    let stdout = std::str::from_utf8( proc.stdout.as_slice() ).unwrap();
+    assert_eq!( stdout, "" );
+    let stderr = std::str::from_utf8( proc.stderr.as_slice() ).unwrap();
+    assert_eq!( stderr, "" );
   }
 }
 
@@ -17,5 +33,6 @@
 
 tests_index!
 {
-  basic,
+  basic_no_args,
+  basic_with_args,
 }
Write test routines `basic_no_args`, `basic_with_args`
