Skip to content

Commit

Permalink
Add snapshots for list_countries()
Browse files Browse the repository at this point in the history
  • Loading branch information
Bisaloo committed Dec 5, 2024
1 parent 3ec9cc8 commit 7decdde
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 0 deletions.
152 changes: 152 additions & 0 deletions tests/testthat/_snaps/list_countries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# list_countries()

Code
contacts_2017
Output
[1] "Albania" "Algeria" "Andorra"
[4] "Antigua & Barbuda" "Argentina" "Armenia"
[7] "Australia" "Austria" "Azerbaijan"
[10] "Bahamas" "Bahrain" "Bangladesh"
[13] "Belarus" "Belgium" "Belize"
[16] "Benin" "Bhutan" "Bolivia"
[19] "Bosnia" "Botswana" "Brazil"
[22] "Brunei" "Bulgaria" "Burkina Faso"
[25] "Cape Verde" "Cambodia" "Cameroon"
[28] "Canada" "Chile" "China"
[31] "Colombia" "Congo - Brazzaville" "Costa Rica"
[34] "Croatia" "Cyprus" "Czechia"
[37] "Denmark" "Dominican Republic" "Ecuador"
[40] "Egypt" "El Salvador" "Estonia"
[43] "Ethiopia" "Fiji" "Finland"
[46] "France" "Georgia" "Germany"
[49] "Ghana" "Greece" "Guatemala"
[52] "Guinea" "Guyana" "Haiti"
[55] "Honduras" "Hong Kong" "Hungary"
[58] "Iceland" "India" "Indonesia"
[61] "Iran" "Iraq" "Ireland"
[64] "Israel" "Italy" "Jamaica"
[67] "Japan" "Jordan" "Kazakhstan"
[70] "Kenya" "Kiribati" "Kuwait"
[73] "Kyrgyzstan" "Laos" "Latvia"
[76] "Lebanon" "Lesotho" "Liberia"
[79] "Lithuania" "Luxembourg" "Malaysia"
[82] "Maldives" "Malta" "Mauritania"
[85] "Mauritius" "Mexico" "Monaco"
[88] "Mongolia" "Montenegro" "Morocco"
[91] "Mozambique" "Namibia" "Nepal"
[94] "Netherlands" "New Zealand" "Nicaragua"
[97] "Niger" "Nigeria" "Oman"
[100] "Pakistan" "Panama" "Paraguay"
[103] "Peru" "Philippines" "Poland"
[106] "Portugal" "Qatar" "South Korea"
[109] "Romania" "Russia" "Rwanda"
[112] "St. Lucia" "Samoa" "São Tomé & Príncipe"
[115] "Saudi Arabia" "Senegal" "Serbia"
[118] "Seychelles" "Sierra Leone" "Singapore"
[121] "Slovakia" "Slovenia" "Solomon Islands"
[124] "South Africa" "Spain" "Sri Lanka"
[127] "Suriname" "Sweden" "Switzerland"
[130] "Syria" "Taiwan" "Tajikistan"
[133] "North Macedonia" "Thailand" "Timor-Leste"
[136] "Tonga" "Tunisia" "Turkey"
[139] "Uganda" "Ukraine" "United Arab Emirates"
[142] "UK" "Tanzania" "US"
[145] "Uruguay" "Uzbekistan" "Vanuatu"
[148] "Venezuela" "Vietnam" "Yemen"
[151] "Zambia" "Zimbabwe"

---

Code
contacts_2020
Output
[1] "Afghanistan" "Angola"
[3] "Albania" "United Arab Emirates"
[5] "Argentina" "Armenia"
[7] "Austria" "Azerbaijan"
[9] "Burundi" "Belgium"
[11] "Benin" "Burkina Faso"
[13] "Bangladesh" "Bulgaria"
[15] "Bahrain" "Bahamas"
[17] "Bosnia" "Belarus"
[19] "Belize" "Bolivia"
[21] "Brazil" "Barbados"
[23] "Brunei" "Bhutan"
[25] "Botswana" "Central African Republic"
[27] "Canada" "Switzerland"
[29] "Chile" "China"
[31] "Côte d’Ivoire" "Cameroon"
[33] "Congo - Kinshasa" "Congo - Brazzaville"
[35] "Colombia" "Comoros"
[37] "Cape Verde" "Costa Rica"
[39] "Cuba" "Cyprus"
[41] "Czechia" "Germany"
[43] "Djibouti" "Denmark"
[45] "Dominican Republic" "Algeria"
[47] "Ecuador" "Egypt"
[49] "Eritrea" "Spain"
[51] "Estonia" "Ethiopia"
[53] "Finland" "Fiji"
[55] "France" "Gabon"
[57] "UK" "Georgia"
[59] "Ghana" "Guinea"
[61] "Gambia" "Guinea-Bissau"
[63] "Equatorial Guinea" "Greece"
[65] "Guatemala" "Guyana"
[67] "Hong Kong" "Honduras"
[69] "Croatia" "Hungary"
[71] "Indonesia" "India"
[73] "Ireland" "Iran"
[75] "Iraq" "Iceland"
[77] "Israel" "Italy"
[79] "Jamaica" "Jordan"
[81] "Kazakhstan" "Kenya"
[83] "Kyrgyzstan" "Cambodia"
[85] "South Korea" "Kuwait"
[87] "Laos" "Liberia"
[89] "Libya" "St. Lucia"
[91] "Sri Lanka" "Lesotho"
[93] "Lithuania" "Luxembourg"
[95] "Latvia" "Macao"
[97] "Morocco" "Moldova"
[99] "Madagascar" "Maldives"
[101] "Mexico" "North Macedonia"
[103] "Mali" "Malta"
[105] "Myanmar" "Montenegro"
[107] "Mongolia" "Mozambique"
[109] "Mauritania" "Mauritius"
[111] "Malawi" "Malaysia"
[113] "Namibia" "Niger"
[115] "Nigeria" "Nicaragua"
[117] "Netherlands" "Norway"
[119] "Nepal" "New Zealand"
[121] "Oman" "Pakistan"
[123] "Panama" "Peru"
[125] "Philippines" "Papua New Guinea"
[127] "Poland" "Puerto Rico"
[129] "North Korea" "Portugal"
[131] "Paraguay" "Palestine"
[133] "Qatar" "Romania"
[135] "Russia" "Rwanda"
[137] "Saudi Arabia" "Sudan"
[139] "Senegal" "Singapore"
[141] "Solomon Islands" "Sierra Leone"
[143] "El Salvador" "Serbia"
[145] "South Sudan" "São Tomé & Príncipe"
[147] "Suriname" "Slovakia"
[149] "Slovenia" "Sweden"
[151] "Eswatini" "Syria"
[153] "Chad" "Togo"
[155] "Thailand" "Tajikistan"
[157] "Turkmenistan" "Timor-Leste"
[159] "Tonga" "Trinidad & Tobago"
[161] "Tunisia" "Turkey"
[163] "Tanzania" "Uganda"
[165] "Ukraine" "Uruguay"
[167] "US" "Uzbekistan"
[169] "St. Vincent & Grenadines" "Venezuela"
[171] "Vietnam" "Vanuatu"
[173] "Samoa" "Yemen"
[175] "South Africa" "Zambia"
[177] "Zimbabwe"

2 changes: 2 additions & 0 deletions tests/testthat/test-list_countries.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ test_that("list_countries()", {

expect_type(contacts_2017, "character")
expect_length(contacts_2017, 152)
expect_snapshot(contacts_2017)

contacts_2020 <- list_countries(data_source = 2020)

expect_type(contacts_2020, "character")
expect_length(contacts_2020, 177)
expect_snapshot(contacts_2020)

})

Expand Down

0 comments on commit 7decdde

Please sign in to comment.