       (testing "from scratch"
                (is (almost-equal? (pc-from-start [1 1]) expected))))))
 
+
+(deftest wrapped-pca-test
+  (letfn [(right-shape [data]
+            (let [res (wrapped-pca (m/matrix data) 2)]
+              (and (:center res) (:comps res))))]
+    (testing "Should not fail and have the right shape for for"
+      (testing "1x1"
+        (is (right-shape [[1]])))
+      (testing "1x2"
+        (is (right-shape [[1 0]])))
+      (testing "2x1"
+        (is (right-shape [[1 0]]))))))
+
+

(ns pca-test
  (:require [clojure.test :refer :all]
            [polismath.named-matrix :refer :all]
            [incanter.core :refer :all]
            [polismath.pca :refer :all]))




(deftest powerit
  (testing "Should generally work"
    (let [data (m/matrix [[ 1 0  0  ]
                        [-1 1  0.1]
                        [ 0 1  0.1]
                        [ 0 1 -0.1]])
