 (expect []
   (no-regex (typify-args [:fish :fry])))
 
-(expect [:id "#[0-9]+"]
+(expect [:id "#^[0-9]+$"]
   (no-regex (typify-args [:id])))
 
-(expect [:id "#[0-9]+"]
+(expect [:id "#^[0-9]+$"]
   (no-regex (typify-args [:id :fish])))
 
-(expect [:id "#[0-9]+" :card-id "#[0-9]+"]
+(expect [:id "#^[0-9]+$" :card-id "#^[0-9]+$"]
   (no-regex (typify-args [:id :card-id])))
 
 

;;; TESTS FOR ROUTE-PARAM-REGEX

;; expectations (internally, `clojure.data/diff`) doesn't think two regexes with the same exact pattern are equal.
;; so in order to make sure we're getting back the right output we'll just change them to strings, e.g. `#"[0-9]+ -> "#[0-9]+"`
(defmacro no-regex [& body]
  `(binding [*auto-parse-types* (update-in *auto-parse-types* [:int :route-param-regex] (partial str "#"))]
     ~@body))

(expect nil
  (no-regex (route-param-regex :fish)))

(expect [:id "#[0-9]+"]
  (no-regex (route-param-regex :id)))

(expect [:card-id "#[0-9]+"]
  (no-regex (route-param-regex :card-id)))



(ns metabase.api.common.internal-test
  (:require [expectations :refer :all]
            [medley.core :as medley]
            (metabase.api.common [internal :refer :all])))

;;; TESTS FOR ROUTE-FN-NAME
