Skip to content

Commit

Permalink
test rdataset: update expected
Browse files Browse the repository at this point in the history
  • Loading branch information
tikkss authored and kou committed Nov 15, 2023
1 parent a21cecf commit f0243a0
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions test/test-rdataset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def setup
test("with package_name") do
records = @dataset.filter(package: "datasets").to_a
assert_equal([
102,
104,
{
package: "datasets",
dataset: "ability.cov",
Expand Down Expand Up @@ -48,7 +48,7 @@ def setup
test("without package_name") do
records = @dataset.each.to_a
assert_equal([
2142,
2264,
{
package: "AER",
dataset: "Affairs",
Expand Down Expand Up @@ -110,8 +110,8 @@ def setup
records = @dataset.each.to_a
assert_equal([
144,
{ time: 1949, value: 112 },
{ time: 1960.91666666667, value: 432 },
{ time: 1949, value: 112, rownames: 1 },
{ time: 1960.91666666667, value: 432, rownames: 144 },
],
[
records.size,
Expand Down Expand Up @@ -141,8 +141,8 @@ def setup
records = @dataset.each.to_a
assert_equal([
153,
{ Ozone: nil, "Solar.R": nil, Wind: 14.3, Temp: 56, Month: 5, Day: 5 },
{ Ozone: 20, "Solar.R": 223, Wind: 11.5, Temp: 68, Month: 9, Day: 30 },
{ Ozone: nil, "Solar.R": nil, Wind: 14.3, Temp: 56, Month: 5, Day: 5, rownames: 5 },
{ Ozone: 20, "Solar.R": 223, Wind: 11.5, Temp: 68, Month: 9, Day: 30, rownames: 153 },
],
[
records.size,
Expand All @@ -161,10 +161,10 @@ def setup
records = @dataset.each.to_a
assert_equal([
182,
{ event: 1, mag: 7, station: "117", dist: 12, accel: 0.359 },
{ event: 16, mag: 5.1, station: nil, dist: 7.6, accel: 0.28 },
{ event: 23, mag: 5.3, station: "c168", dist: 25.3, accel: 0.23 },
{ event: 23, mag: 5.3, station: "5072", dist: 53.1, accel: 0.022 }
{ event: 1, mag: 7, station: 117, dist: 12, accel: 0.359, rownames: 1 },
{ event: 16, mag: 5.1, station: nil, dist: 7.6, accel: 0.28, rownames: 79 },
{ event: 23, mag: 5.3, station: "c168", dist: 25.3, accel: 0.23, rownames: 170 },
{ event: 23, mag: 5.3, station: 5072, dist: 53.1, accel: 0.022, rownames: 182 }
],
[
records.size,
Expand All @@ -187,8 +187,8 @@ def setup
records = @dataset.each.to_a
assert_equal([
192,
{ temp: 10, species: 'wheat', start: 0, end: 1.0, germinated: 0 },
{ temp: 40, species: 'rice', start: 18, end: Float::INFINITY, germinated: 12 }
{ temp: 10, species: 'wheat', start: 0, end: 1, germinated: 0, rownames: 1 },
{ temp: 40, species: 'rice', start: 18, end: Float::INFINITY, germinated: 12, rownames: 192 }
],
[
records.size,
Expand All @@ -213,25 +213,27 @@ def setup
Order: 398_481,
Level: 1,
Code: 'A',
Parent: '',
Parent: nil,
Description: 'AGRICULTURE, FORESTRY AND FISHING',
This_item_includes: 'This section includes the exploitation of vegetal and animal natural resources, comprising the activities of growing of crops, raising and breeding of animals, harvesting of timber and other plants, animals or animal products from a farm or their natural habitats.',
This_item_also_includes: '',
Rulings: '',
This_item_excludes: '',
"Reference_to_ISIC_Rev._4": 'A'
This_item_also_includes: nil,
Rulings: nil,
This_item_excludes: nil,
"Reference_to_ISIC_Rev._4": 'A',
rownames: 1
},
{
Order: 399_476,
Level: 4,
Code: '99.00',
Parent: '99.0',
Code: 99.0,
Parent: 99.0,
Description: 'Activities of extraterritorial organisations and bodies',
This_item_includes: "This class includes:\n- activities of international organisations such as the United Nations and the specialised agencies of the United Nations system, regional bodies etc., the International Monetary Fund, the World Bank, the World Customs Organisation, the Organisation for Economic Co-operation and Development, the organisation of Petroleum Exporting Countries, the European Communities, the European Free Trade Association etc.",
This_item_also_includes: "This class also includes:\n- activities of diplomatic and consular missions when being determined by the country of their location rather than by the country they represent",
Rulings: '',
This_item_excludes: '',
"Reference_to_ISIC_Rev._4": '9900'
Rulings: nil,
This_item_excludes: nil,
"Reference_to_ISIC_Rev._4": 9900,
rownames: 996
}
],
[
Expand Down

0 comments on commit f0243a0

Please sign in to comment.