 defmodule RadpathTests.RadpathFacts do
 
   # use Amrita.Sweet
-  # use ExUnit.Case, async: true
-  use ExUnit.Case
+  use ExUnit.Case, async: true
   use PatternTap
 
   import PathHelpers

      rescue
        e in RuntimeError -> e
      end
    end
  end

  defmodule FilteringTest do

        assert File.exists?(path)
    end

    test "zip" do
      try do
        Path.join(fixture_path, "Testdir1.zip") |> File.exists? |> refute
        Radpath.zip([fixture_path], "Testdir1.zip")
        "Testdir1.zip" |> File.exists?
        System.cmd("zip",["-T","Testdir1.zip"]) |> (&(assert &1 = {"test of Testdir1.zip OK\n", 0})).()
        System.cmd("zipinfo",["-1","Testdir1.zip"]) |> 
        tap({result_str, _} ~> result_str) |> 
        (&(String.contains?(&1, "testdir1"))).()
      after
        File.rm_rf("Testdir1.zip")
      end
    end

    test "zip: onepath" do
      dir = Path.join(fixture_path, "testdir2")
      try do
        Path.join(fixture_path, "Testdir2.zip") |> File.exists? |> refute
        Radpath.zip([dir], "Testdir2.zip")
        "Testdir2.zip" |> File.exists?
        
        System.cmd("zip",["-T","Testdir2.zip"]) |> 
        tap({result_str, _} ~> result_str) |> 
        String.strip |> (&( assert &1 == "test of Testdir2.zip OK")).()
        
        System.cmd("zipinfo",["-1","Testdir2.zip"]) |> 
        tap({result_str2, _} ~> result_str2) |> 
        (&(String.contains?(&1, "testdir2"))).() |> assert
      
      after
        File.rm_rf("Testdir2.zip")
      end
    end
  end

  test "zip: OnebitstringPath" do
    dir = Path.join(fixture_path, "testdir1")
    try do
      Path.join(fixture_path, "Testdir3.zip") |> File.exists? |> refute
      Radpath.zip(dir, "Testdir3.zip")
      "Testdir3.zip" |> File.exists?

      System.cmd("zip",["-T","Testdir3.zip"]) |>
      tap({result_str, _} ~> result_str) |> 
      String.strip |> 
      (&(assert &1 == "test of Testdir3.zip OK")).()
      
      System.cmd("zipinfo",["-1","Testdir3.zip"])
      |> tap({result_str, _} ~> result_str)
      |> (&(String.contains?(&1, "testdir1"))).()
    
    after
      File.rm_rf("Testdir3.zip")
    end
  end

  test "unzip: One bitstring path in CWD" do
    try do
      Path.join(fixture_path, "dome.csv") |> File.exists? |> refute
      Radpath.unzip(Path.join(fixture_path, "dome.zip"), fixture_path)
      Path.join(fixture_path, "dome.csv") |> File.exists?
    after
      File.rm_rf(Path.join(fixture_path, "dome.csv"))
    end
  end

  test "unzip: One bitstring path in tmp" do
    try do
      Path.join(fixture_path, "dome.csv") |> File.exists? |> refute
      Radpath.unzip(Path.join(fixture_path, "dome.zip"), "/tmp")
    after
      Path.join("/tmp", "dome.csv") |> File.exists?
    end
  end

  test "zip: path that does not exist" do
    try do
        Path.join(fixture_path, "Testdir-dont-exist.zip") |>
                   File.exists? |> refute 
