anchor.diff:      let resultStr = initString 3 funStr
       if resultStr <> [|"Lists"; "are";  "commonly"  |] then Assert.Fail()
           
  -    // empty array  
  +    // empty vector  
       let resultEpt = initInt 0 (fun x -> x+1)
       if resultEpt <> [| |] then Assert.Fail()
           
  
positive.code:         
  [<TestCase>]  
  let map () : unit =
      MapTester Array.map Array.map
          
  [<TestCase>]
  let mapWithSideEffects  () : unit =
  
negative.code: 
  [<TestCase>]
  let init () : unit = 
      InitTester Vector.init Vector.init
          
  [<TestCase>]
  let initWithSideEffects () : unit =
      let stamp = ref 0
      let f i = 
          stamp := !stamp + 1; 
          i 
      Vector.init 0 f |> ignore
      Assert.AreEqual (0, !stamp)
          
      stamp := 0
      Vector.init 10 f |> ignore
      Assert.AreEqual (10, !stamp)
  
  [<TestCase>]
  let isEmpty () : unit =
      // integer vector
      let intArr = [| 3;4;7;8;10 |]    
      let resultInt = Vector.isEmpty intArr 
      if resultInt <> false then Assert.Fail()
          
      // string vector
      let strArr = [|"Lists"; "are";  "commonly" ; "list" |]    
      let resultStr = Vector.isEmpty strArr 
      if resultStr <> false then Assert.Fail()
          
      // empty vector    
      let emptyArr:vector<int> = [| |]
      let resultEpt = Vector.isEmpty emptyArr 
      if resultEpt <> true then Assert.Fail()
  
      // null vector
      let nullArr = null:string[] 
      checkThrowsArgumentNullException (fun () -> Vector.isEmpty nullArr |> ignore)  
          
      ()
  
  [<TestCase>]
  let iter () : unit =
      // integer vector
      let intArr = [| 1..10 |]  
      let resultInt = ref 0    
      let funInt (x:int) =   
          resultInt := !resultInt + x              
          () 
      Vector.iter funInt intArr 
      if !resultInt <> 55 then Assert.Fail()    
          
      // string vector
      let strArr = [|"Lists"; "are";  "commonly" ; "list" |]
      let resultStr = ref ""
      let funStr (x : string) =
          resultStr := (!resultStr) + x   
          ()
      Vector.iter funStr strArr  
      if !resultStr <> "Listsarecommonlylist" then Assert.Fail()   
          
      // empty vector    
      let emptyArr : vector<int> = [| |]
      let resultEpt = ref 0
      Vector.iter funInt emptyArr 
      if !resultEpt <> 0 then Assert.Fail()    
  
      // null vector
      let nullArr = null : string[]  
      checkThrowsArgumentNullException (fun () -> Vector.iter funStr nullArr |> ignore)  
          
      ()
         
  [<TestCase>]
  let iter2 () : unit =
      // integer vector
      let resultInt = ref 0    
      let funInt (x:int) (y:int) =   
          resultInt := !resultInt + x + y             
          () 
      Vector.iter2 funInt [| 1..10 |] [|2..2..20|] 
      if !resultInt <> 165 then Assert.Fail()    
          
      // string vector
      let resultStr = ref ""
      let funStr (x:string) (y:string) =
          resultStr := (!resultStr) + x  + y 
          ()
      Vector.iter2 funStr [|"A"; "B";  "C" ; "D" |] [|"a"; "b"; "c"; "d"|]  
      if !resultStr <> "AaBbCcDd" then Assert.Fail()   
          
      // empty vector    
      let emptyArr:vector<int> = [| |]
      let resultEpt = ref 0
      Vector.iter2 funInt emptyArr emptyArr 
      if !resultEpt <> 0 then Assert.Fail()    
  
      // null vector
      let nullArr = null:string[]  
      let validArray = [| "a" |]     
      checkThrowsArgumentNullException (fun () -> Vector.iter2 funStr nullArr validArray |> ignore)  
      checkThrowsArgumentNullException (fun () -> Vector.iter2 funStr validArray nullArr |> ignore)  
          
      // len1 <> len2        
      checkThrowsArgumentException(fun () -> Vector.iter2 funInt [| 1..10 |] [|2..20|])
    
      ()
          
          
  [<TestCase>]
  let iteri () : unit =
      // integer vector
      let intArr = [| 1..10 |]  
      let resultInt = ref 0    
      let funInt (x:int) y =   
          resultInt := !resultInt + x + y             
          () 
      Vector.iteri funInt intArr 
      if !resultInt <> 100 then Assert.Fail()    
          
      // string vector
      let strArr = [|"Lists"; "are";  "commonly" ; "list" |]
      let resultStr = ref 0
      let funStr (x:int) (y:string) =
          resultStr := (!resultStr) + x + y.Length
          ()
      Vector.iteri funStr strArr  
      if !resultStr <> 26 then Assert.Fail()   
          
      // empty vector    
      let emptyArr:vector<int> = [| |]
      let resultEpt = ref 0
      Vector.iteri funInt emptyArr 
      if !resultEpt <> 0 then Assert.Fail()    
  
      // null vector
      let nullArr = null:string[] 
      checkThrowsArgumentNullException (fun () -> Vector.iteri funStr nullArr |> ignore)  
          
      ()
          
  [<TestCase>]
  let iteri2 () : unit =
      // integer vector
      let resultInt = ref 0    
      let funInt (x:int) (y:int) (z:int) =   
          resultInt := !resultInt + x + y + z            
          () 
      Vector.iteri2 funInt [| 1..10 |] [|2..2..20|] 
      if !resultInt <> 210 then Assert.Fail()    
          
      // string vector
      let resultStr = ref ""
      let funStr (x:int) (y:string) (z:string) =
          resultStr := (!resultStr) + x.ToString()  + y + z
          ()
      Vector.iteri2 funStr [|"A"; "B";  "C" ; "D" |] [|"a"; "b"; "c"; "d"|]  
      if !resultStr <> "0Aa1Bb2Cc3Dd" then Assert.Fail()   
          
      // empty vector    
      let emptyArr:vector<int> = [| |]
      let resultEpt = ref 0
      Vector.iteri2 funInt emptyArr emptyArr 
      if !resultEpt <> 0 then Assert.Fail()    
  
      // null vector
      let nullArr = null:string[]
      let validArray = [| "a" |] 
      checkThrowsArgumentNullException (fun () -> Vector.iteri2 funStr nullArr validArray |> ignore)  
      checkThrowsArgumentNullException (fun () -> Vector.iteri2 funStr validArray nullArr |> ignore)  
          
      // len1 <> len2
      checkThrowsArgumentException(fun () -> Vector.iteri2 funInt [| 1..10 |] [|2..20|]  |> ignore)
          
      ()                
  
  let private MapTester mapInt (mapString : (string -> int) -> vector<string> -> vector<int>) =
      // empty vector 
      let f x = x + 1
      let result = mapInt f [| |]
      if result <> [| |] then Assert.Fail ()
          
      // int vector
      let result = mapInt f [| 1..100 |]
      if result <> [| 2..101 |] then Assert.Fail ()
          
      // string vector
      let result = [| "a"; "aa"; "aaa" |] |> mapString (fun s -> s.Length) 
      if result <> [| 1..3 |] then Assert.Fail ()
          
      // null vector
      let nullArg : int [] = null
      checkThrowsArgumentNullException (fun () -> mapInt f nullArg |> ignore)
          
  