diff --git a/.travis.yml b/.travis.yml index f8b7c5df..05f6591d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,4 @@ before_install: - export TRAVIS_BUILD_DIR=$HOME/gopath/src/github.com/senorprogrammer/wtf - cd $HOME/gopath/src/github.com/senorprogrammer/wtf -script: go get ./... && go get github.com/go-test/deep && go test -v github.com/senorprogrammer/wtf/wtftests/... +script: go get ./... && go get github.com/go-test/deep && go test -v github.com/senorprogrammer/wtf/wtf_tests/... diff --git a/weather.txt b/weather.txt new file mode 100644 index 00000000..fb2c1f84 --- /dev/null +++ b/weather.txt @@ -0,0 +1,40 @@ +Weather report: Vancouver, Canada + +  \ / Partly cloudy +  _ /"".-.  24-25 Β°C +  \_( ).  ← 24 km/h +  /(___(__)  48 km + 0.1 mm + β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ Tue 31 Jul β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ Morning β”‚ Noon β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ Evening β”‚ Night β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚  _`/"".-.  Patchy rain po…│  \ / Partly cloudy β”‚  \ /  Sunny β”‚  \ /  Clear β”‚ +β”‚  ,\_( ).  19-20 Β°C β”‚  _ /"".-.  20 Β°C β”‚  .-.  21-22 Β°C β”‚  .-.  20-21 Β°C β”‚ +β”‚  /(___(__)  β†– 15-24 km/h β”‚  \_( ).  ↑ 14-21 km/h β”‚  ― ( ) ―  β†– 10-17 km/h β”‚  ― ( ) ―  ← 9-21 km/h β”‚ +β”‚  β€˜ β€˜ β€˜ β€˜  16 km β”‚  /(___(__)  16 km β”‚  `-’  16 km β”‚  `-’  16 km β”‚ +β”‚  β€˜ β€˜ β€˜ β€˜  0.1 mm | 82% β”‚ 0.1 mm | 54% β”‚  / \  0.0 mm | 0% β”‚  / \  0.0 mm | 0% β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ + β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ Wed 01 Aug β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ Morning β”‚ Noon β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ Evening β”‚ Night β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚  \ / Partly cloudy β”‚  \ / Partly cloudy β”‚  \ / Partly cloudy β”‚  \ / Partly cloudy β”‚ +β”‚  _ /"".-.  18 Β°C β”‚  _ /"".-.  19 Β°C β”‚  _ /"".-.  19-20 Β°C β”‚  _ /"".-.  19-20 Β°C β”‚ +β”‚  \_( ).  β†– 20-23 km/h β”‚  \_( ).  β†– 18-23 km/h β”‚  \_( ).  β†– 12-21 km/h β”‚  \_( ).  ← 11-24 km/h β”‚ +β”‚  /(___(__)  16 km β”‚  /(___(__)  16 km β”‚  /(___(__)  15 km β”‚  /(___(__)  15 km β”‚ +β”‚ 0.0 mm | 0% β”‚ 0.0 mm | 0% β”‚ 0.0 mm | 0% β”‚ 0.0 mm | 0% β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ + β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ Thu 02 Aug β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ Morning β”‚ Noon β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ Evening β”‚ Night β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚  \ / Partly cloudy β”‚  \ / Partly cloudy β”‚ Cloudy β”‚  \ / Partly cloudy β”‚ +β”‚  _ /"".-.  16 Β°C β”‚  _ /"".-.  16-17 Β°C β”‚  .--.  17-18 Β°C β”‚  _ /"".-.  17-18 Β°C β”‚ +β”‚  \_( ).  β†– 20-25 km/h β”‚  \_( ).  β†– 17-29 km/h β”‚  .-( ).  β†– 12-26 km/h β”‚  \_( ).  ← 11-21 km/h β”‚ +β”‚  /(___(__)  15 km β”‚  /(___(__)  14 km β”‚  (___.__)__)  13 km β”‚  /(___(__)  11 km β”‚ +β”‚ 0.0 mm | 0% β”‚ 0.0 mm | 0% β”‚ 0.0 mm | 0% β”‚ 0.0 mm | 0% β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ + +New feature: multilingual location names wttr.in/станция+Восток (in UTF-8) and location search wttr.in/~Kilimanjaro (just add ~ before) +Follow @igor_chubin for wttr.in updates diff --git a/wtftests/bargraph/bargraph_test.go b/wtf_tests/bargraph/bargraph_test.go similarity index 96% rename from wtftests/bargraph/bargraph_test.go rename to wtf_tests/bargraph/bargraph_test.go index 41c2ef7b..02a383e9 100644 --- a/wtftests/bargraph/bargraph_test.go +++ b/wtf_tests/bargraph/bargraph_test.go @@ -1,4 +1,4 @@ -package bargraphtests +package bargraph_test import ( "testing" diff --git a/wtf_tests/colors_test.go b/wtf_tests/colors_test.go new file mode 100644 index 00000000..8c2e6f77 --- /dev/null +++ b/wtf_tests/colors_test.go @@ -0,0 +1,14 @@ +package wtf_tests + +import ( + "testing" + + . "github.com/senorprogrammer/wtf/wtf" + . "github.com/stretchr/testify/assert" +) + +func TestASCIItoTviewColors(t *testing.T) { + Equal(t, "", ASCIItoTviewColors("")) + Equal(t, "cat", ASCIItoTviewColors("cat")) + Equal(t, "[38;5;226mcat/[-]", ASCIItoTviewColors("[38;5;226mcat/")) +} diff --git a/wtftests/datetime_test.go b/wtf_tests/datetime_test.go similarity index 96% rename from wtftests/datetime_test.go rename to wtf_tests/datetime_test.go index a9159d07..8415d345 100644 --- a/wtftests/datetime_test.go +++ b/wtf_tests/datetime_test.go @@ -1,4 +1,4 @@ -package wtftests +package wtf_tests import ( "testing" diff --git a/wtftests/position_test.go b/wtf_tests/position_test.go similarity index 96% rename from wtftests/position_test.go rename to wtf_tests/position_test.go index 336bc964..370a3373 100644 --- a/wtftests/position_test.go +++ b/wtf_tests/position_test.go @@ -1,4 +1,4 @@ -package wtftests +package wtf_tests import ( "testing" diff --git a/wtftests/utils_test.go b/wtf_tests/utils_test.go similarity index 99% rename from wtftests/utils_test.go rename to wtf_tests/utils_test.go index b1aa7994..d78425cc 100644 --- a/wtftests/utils_test.go +++ b/wtf_tests/utils_test.go @@ -1,4 +1,4 @@ -package wtftests +package wtf_tests import ( "testing"