From dd92df15f9ccdd1ff553624589d2cded4c09a686 Mon Sep 17 00:00:00 2001 From: John Wiseman Date: Sun, 3 May 2020 16:18:10 -0700 Subject: [PATCH] Renaming circlebot -> advisorycircular. --- shadow-cljs.edn | 4 +-- .../generation_test.cljs | 4 +-- .../util_test.cljs | 4 +-- ...t_test.cljs => advisorycircular_test.cljs} | 36 +++++++++---------- 4 files changed, 24 insertions(+), 24 deletions(-) rename src/test/lemondronor/{circlebot => advisorycircular}/generation_test.cljs (96%) rename src/test/lemondronor/{circlebot => advisorycircular}/util_test.cljs (86%) rename src/test/lemondronor/{circlebot_test.cljs => advisorycircular_test.cljs} (90%) diff --git a/shadow-cljs.edn b/shadow-cljs.edn index b1e4a2c..fe57cb7 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -11,8 +11,8 @@ :builds {:script {:target :node-script - :main lemondronor.circlebot/main - :output-to "out/script.js"} + :main lemondronor.advisorycircular/main + :output-to "out/advisorycircular.js"} :test {:target :node-test :output-to "out/node-tests.js" diff --git a/src/test/lemondronor/circlebot/generation_test.cljs b/src/test/lemondronor/advisorycircular/generation_test.cljs similarity index 96% rename from src/test/lemondronor/circlebot/generation_test.cljs rename to src/test/lemondronor/advisorycircular/generation_test.cljs index ef276e7..ab26edc 100644 --- a/src/test/lemondronor/circlebot/generation_test.cljs +++ b/src/test/lemondronor/advisorycircular/generation_test.cljs @@ -1,6 +1,6 @@ -(ns lemondronor.circlebot.generation-test +(ns lemondronor.advisorycircular.generation-test (:require [cljs.test :refer (deftest is testing)] - [lemondronor.circlebot.generation :as generation])) + [lemondronor.advisorycircular.generation :as generation])) (deftest parse-template (is (= [:optional [:varref "woo"]] diff --git a/src/test/lemondronor/circlebot/util_test.cljs b/src/test/lemondronor/advisorycircular/util_test.cljs similarity index 86% rename from src/test/lemondronor/circlebot/util_test.cljs rename to src/test/lemondronor/advisorycircular/util_test.cljs index 9fb8549..0a363dd 100644 --- a/src/test/lemondronor/circlebot/util_test.cljs +++ b/src/test/lemondronor/advisorycircular/util_test.cljs @@ -1,6 +1,6 @@ -(ns lemondronor.circlebot.util-test +(ns lemondronor.advisorycircular.util-test (:require [cljs.test :refer (deftest is testing)] - [lemondronor.circlebot.util :as util])) + [lemondronor.advisorycircular.util :as util])) (deftest deep-merge (is (= (util/deep-merge diff --git a/src/test/lemondronor/circlebot_test.cljs b/src/test/lemondronor/advisorycircular_test.cljs similarity index 90% rename from src/test/lemondronor/circlebot_test.cljs rename to src/test/lemondronor/advisorycircular_test.cljs index 0963b2f..addaf57 100644 --- a/src/test/lemondronor/circlebot_test.cljs +++ b/src/test/lemondronor/advisorycircular_test.cljs @@ -1,6 +1,6 @@ -(ns lemondronor.circlebot-test +(ns lemondronor.advisorycircular-test (:require [cljs.test :refer (deftest is testing)] - [lemondronor.circlebot :as circlebot])) + [lemondronor.advisorycircular :as advisorycircular])) (def epsilon 0.0000010) @@ -27,7 +27,7 @@ "opicao" "AAR", "interested" "0", "trak" "264.4", "type" "A388", "trkh" "0", "icao" "71BE34", "lat" "33.937908", "vsit" "1", "tisb" "0", "vsi" "0", "sat" "0"}] - (is (= (circlebot/parse-adsbexchange-ac-element ac) + (is (= (advisorycircular/parse-adsbexchange-ac-element ac) {:icao "71BE34" :registration "HL7634" :callsign nil @@ -44,7 +44,7 @@ (deftest prune-history (let [hist [{:time 0 :id 0} {:time 1000000 :id 1} {:time 2000000 :id 2}]] - (is (= (circlebot/prune-history hist 2500000 circlebot/default-config) + (is (= (advisorycircular/prune-history hist 2500000 advisorycircular/default-config) [{:time 2000000 :id 2}])))) @@ -62,7 +62,7 @@ :lat 1 :lon 1 :postime 3500}] - (is (= (circlebot/update-history-db-record db record) + (is (= (advisorycircular/update-history-db-record db record) {"0" {:icao "0" :lat 1 :lon 1 @@ -85,7 +85,7 @@ :lat 1 :lon 1 :postime 3500}] - (is (= (circlebot/update-history-db-record db record) + (is (= (advisorycircular/update-history-db-record db record) {"0" {:icao "0" :lat 0 :lon 0 @@ -103,24 +103,24 @@ (deftest expand-template (let [data {:locality "Palmdale", :continent "North America", :military? true, :alt 3850, :speed "209", :normalized-curviness 14.768651250300287, :accuracy "centroid", :country_a "USA", :continent_gid "whosonfirst:continent:102191575", :name "Palmdale", :squawk "5330", :icao "AE1482", :county_a "LO", :county "Los Angeles County", :source "whosonfirst", :gid "whosonfirst:locality:85923493", :curviness 1269.8089810739468, :locality_gid "whosonfirst:locality:85923493", :region "California", :militaryicao "AE1482", :region_a "CA", :nearbydistance 8.167, :callsign "RAIDR49", :layer "locality", :mlat? false, :country_gid "whosonfirst:country:85633793", :label "Palmdale, CA, USA", :id "85923493", :lon -118.00375, :region_gid "whosonfirst:region:85688637", :lat 34.661074, :militaryregistration "166765", :county_gid "whosonfirst:county:102086957", :started-circling-time 1576266715691, :distance 6.855, :source_id "85923493", :registration "166765", :confidence 0.5, :country "United States", :postime 1576266689756, :nearbylandmark "Living Faith Foursquare Church"}] - (is (strmatch #"military" (-> (circlebot/expand-template data) :text)))) + (is (strmatch #"military" (-> (advisorycircular/expand-template data) :text)))) (let [data {:locality "Palmdale", :continent "North America", :military? true, :alt 3200, :speed "161", :normalized-curviness 15.783422690487765, :accuracy "centroid", :country_a "USA", :continent_gid "whosonfirst:continent:102191575", :name "Palmdale", :squawk "5330", :icao "AE1482", :county_a "LO", :county "Los Angeles County", :source "whosonfirst", :gid "whosonfirst:locality:85923493", :curviness 1098.803548060181, :locality_gid "whosonfirst:locality:85923493", :region "California", :militaryicao "AE1482", :region_a "CA", :nearbydistance 7.828, :callsign "RAIDR49", :layer "locality", :mlat? false, :country_gid "whosonfirst:country:85633793", :label "Palmdale, CA, USA", :id "85923493", :lon -118.049183, :region_gid "whosonfirst:region:85688637", :lat 34.649808, :militaryregistration "166765", :county_gid "whosonfirst:county:102086957", :started-circling-time 1576267564959, :distance 6.336, :source_id "85923493", :registration "166765", :confidence 0.5, :country "United States", :postime 1576267555709, :nearbylandmark "Living Faith Foursquare Church"}] - (is (strmatch #"military" (-> (circlebot/expand-template data) :text)))) + (is (strmatch #"military" (-> (advisorycircular/expand-template data) :text)))) (testing "a vs. an for type" (let [data {:registration "TEST" :icao "123" :type "Airbus 380" :locality "Test City"}] - (is (strmatch #"an Airbus" (:text (circlebot/expand-template data))))) + (is (strmatch #"an Airbus" (:text (advisorycircular/expand-template data))))) (let [data {:registration "TEST" :icao "123" :type "Yoyo 380" :locality "Test City"}] - (is (strmatch #"a Yoyo" (:text (circlebot/expand-template data))))))) + (is (strmatch #"a Yoyo" (:text (advisorycircular/expand-template data))))))) (deftest merge-adsbx-sqb - (is (= (circlebot/merge-adsbx-sqb {:registration "N1"} + (is (= (advisorycircular/merge-adsbx-sqb {:registration "N1"} {:registration "N2" :type "B52"}) {:registration "N1", :type "B52"})) - (is (= (circlebot/merge-adsbx-sqb {:registration nil} + (is (= (advisorycircular/merge-adsbx-sqb {:registration nil} {:registration "N2" :type "B52"}) {:registration "N2", :type "B52"})) - (is (= (circlebot/merge-adsbx-sqb {:registration "N1"} + (is (= (advisorycircular/merge-adsbx-sqb {:registration "N1"} {:registration "N2" :type nil}) {:registration "N1", :type nil}))) @@ -133,7 +133,7 @@ :type "B52"} reverse {:properties {:neighbourhood "Silver Lake" :locality "Los Angeles"}} nearby nil - desc (circlebot/generate-description ac sqb reverse nearby)] + desc (advisorycircular/generate-description ac sqb reverse nearby)] (is (strmatch #"NBADB0Y" desc)) (is (strmatch #"a B52" desc)) (is (strmatch #"Silver Lake.*Los Angeles" desc)) @@ -144,7 +144,7 @@ :type "B52"} reverse {:properties {:neighbourhood "Silver Lake" :locality "Los Angeles"}} nearby {:name "Disneyland" :distance 2} - desc (circlebot/generate-description ac sqb reverse nearby)] + desc (advisorycircular/generate-description ac sqb reverse nearby)] (is (strmatch #"NGOODB0Y" desc)) (is (strmatch #"a B52" desc)) (is (strmatch #"Silver Lake.*Los Angeles" desc)) @@ -155,7 +155,7 @@ sqb {:registration "N80NT", :type "Eurocopter Squirrel AS 350 B2"} reverse {:properties {:neighbourhood "Silver Lake" :locality "Los Angeles"}} nearby {:name "Disneyland" :distance 2} - desc (circlebot/generate-description ac sqb reverse nearby)] + desc (advisorycircular/generate-description ac sqb reverse nearby)] (is (strmatch #"N80NT" desc)) (is (strmatch #"a Eurocopter Squirrel AS 350 B2" desc)) (is (strmatch #"callsign N80NT" desc)) @@ -171,10 +171,10 @@ (let [landmarks [{:properties {:name "Johnny Depp"}} {:properties {:name "Musso & Frank's"}} {:properties {:name "Johnny Depp's Star"}}]] - (is (= (circlebot/filter-landmarks {:blocklist ["Johnny Depp"]} + (is (= (advisorycircular/filter-landmarks {:blocklist ["Johnny Depp"]} landmarks) [{:properties {:name "Musso & Frank's"}}])) - (is (= (circlebot/filter-landmarks {:blocklist ["Frank"]} + (is (= (advisorycircular/filter-landmarks {:blocklist ["Frank"]} landmarks) [{:properties {:name "Johnny Depp"}} {:properties {:name "Johnny Depp's Star"}}])))))