Compare commits

..

No commits in common. '7379dcadae01ed43dc84f3923d472b996f443cb3' and '3d1b3ac76b113462f23ba0445862f30e0f2a75f3' have entirely different histories.

  1. 17
      src/rustint/core.clj
  2. 70
      test/rustint/core_test.clj

@ -2179,7 +2179,7 @@
)
(defn get-rust-formatters [s]
(map last (re-seq #"\{:?(.\d+)?\}" s))
(map last (re-seq #"\{:?(.\d)?\}" s))
)
(defn convertir-formato-impresion [args]
@ -2189,20 +2189,7 @@
(rest args)
(get-rust-formatters (first args))
)
] (if (empty? clojure-fspecifiers)
args
(into
(rest args)
(list (clojure.string/join
(interleave
(clojure.string/split (first args) #"\{:?(\.\d+)?\}")
(concat clojure-fspecifiers '(""))
)
))
)
)
)
] args)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

@ -287,76 +287,6 @@
)
)
(deftest convertir-formato-impresion-04
(testing "Test 04 convertir-formato-impresion"
(is (=
(convertir-formato-impresion '("Hola, mundo {}!" 2.0))
'("Hola, mundo %.0f!" 2.0)
)
)
)
)
(deftest convertir-formato-impresion-05
(testing "Test 05 convertir-formato-impresion"
(is (=
(convertir-formato-impresion '("Hola, mundo {}!" "2"))
'("Hola, mundo %s!" "2")
)
)
)
)
(deftest convertir-formato-impresion-06
(testing "Test 06 convertir-formato-impresion"
(is (=
(convertir-formato-impresion '("Hola, mundo {} {} {}!" 2 2.0 "2"))
'("Hola, mundo %d %.0f %s!" 2 2.0 "2")
)
)
)
)
(deftest convertir-formato-impresion-07
(testing "Test 07 convertir-formato-impresion"
(is (=
(convertir-formato-impresion '("Hola, mundo {:.8}!" 2.0))
'("Hola, mundo %.8f!" 2.0)
)
)
)
)
(deftest convertir-formato-impresion-08
(testing "Test 08 convertir-formato-impresion"
(is (=
(convertir-formato-impresion '("- My name is {}, James {}.\n- Hello, {}{}{}!" "Bond" "Bond" 0 0 7))
'("- My name is %s, James %s.\n- Hello, %d%d%d!" "Bond" "Bond" 0 0 7)
)
)
)
)
(deftest convertir-formato-impresion-09
(testing "Test 09 convertir-formato-impresion"
(is (=
(convertir-formato-impresion '("{} elevado a la {} es\t{}" 2.0 2 4.0))
'("%.0f elevado a la %d es\t%.0f" 2.0 2 4.0)
)
)
)
)
(deftest convertir-formato-impresion-10
(testing "Test 10 convertir-formato-impresion"
(is (=
(convertir-formato-impresion '("Las raices cuadradas de {} son +{:.8} y -{:.8}" 4.0 1.999999999985448 1.999999999985448))
'("Las raices cuadradas de %.0f son +%.8f y -%.8f" 4.0 1.999999999985448 1.999999999985448)
)
)
)
)
(deftest get-rust-formatters-01
(testing "Test 01 get-rust-formatters"
(is (=

Loading…
Cancel
Save