<commit_before>--[[
  This file is part of ClearTables
  @author <NAME> <<EMAIL>>
  @copyright 2015 <NAME>, MIT license
]]--

require "water"

print("TESTING: accept_water_area")
assert(accept_water_area({natural="water"}), "test failed: natural=water")
assert(accept_water_area({waterway="riverbank"}), "test failed: waterway=riverbank")
assert(accept_water_area({landuse="reservoir"}), "test failed: landuse=reservoir")
assert(not accept_water_area({}), "test failed: untagged")
assert(not accept_water_area({foo="bar"}), "test failed: other tags")

print("TESTING: transform_water_area")
assert(deepcompare(transform_water_area({}), {}), "test failed: no tags")
assert(deepcompare(transform_water_area({natural="water"}), {}), "test failed: only natural")
assert(deepcompare(transform_water_area({name="foo"}), {name="foo"}), "test failed: name")
assert(deepcompare(transform_water_area({name="foo", bar="baz"}), {name="foo"}), "test failed: dropping other tags")
assert(deepcompare(transform_water_area({water="foo"}), {water="foo"}), "test failed: water tag")<commit_msg>reorder water area tests<commit_after>--[[
  This file is part of ClearTables

  @author <NAME> <<EMAIL>>
  @copyright 2015 <NAME>, MIT license
]]--

require "water"

print("TESTING: accept_water_area")
assert(not accept_water_area({}), "test failed: untagged")
assert(not accept_water_area({foo="bar"}), "test failed: other tags")
assert(accept_water_area({natural="water"}), "test failed: natural=water")
assert(accept_water_area({waterway="riverbank"}), "test failed: waterway=riverbank")
assert(accept_water_area({landuse="reservoir"}), "test failed: landuse=reservoir")

print("TESTING: transform_water_area")
assert(deepcompare(transform_water_area({}), {}), "test failed: no tags")
assert(deepcompare(transform_water_area({natural="water"}), {}), "test failed: only natural")
assert(deepcompare(transform_water_area({name="foo"}), {name="foo"}), "test failed: name")
assert(deepcompare(transform_water_area({name="foo", bar="baz"}), {name="foo"}), "test failed: dropping other tags")
assert(deepcompare(transform_water_area({water="foo"}), {water="foo"}), "test failed: water tag")
{'fraction_non_alphanumeric': 0.18391866913123844, 'fraction_numerical': 0.0036968576709796672, 'mean_word_length': 10.96132596685083, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2171439', 'n_tokens_mistral': 684, 'n_tokens_neox': 648, 'n_words': 148}