changeset = create(:changeset)
key = "k"
- (0..255).each do |i|
+ [0, 255].each do |i|
tag = ChangesetTag.new
tag.changeset_id = changeset.id
tag.k = key * i
changeset = create(:changeset)
val = "v"
- (0..255).each do |i|
+ [0, 255].each do |i|
tag = ChangesetTag.new
tag.changeset_id = changeset.id
tag.k = "k"
end
def test_utf8_roundtrip
- (1..255).each do |i|
+ [1, 255].each do |i|
assert_message_ok("c", i)
assert_message_ok(EURO, i)
end
class NodeTagTest < ActiveSupport::TestCase
def test_length_key_valid
tag = create(:node_tag)
- (0..255).each do |i|
+ [0, 255].each do |i|
tag.k = "k" * i
assert tag.valid?
end
def test_length_value_valid
tag = create(:node_tag)
- (0..255).each do |i|
+ [0, 255].each do |i|
tag.v = "v" * i
assert tag.valid?
end
class OldNodeTagTest < ActiveSupport::TestCase
def test_length_key_valid
tag = create(:old_node_tag)
- (0..255).each do |i|
+ [0, 255].each do |i|
tag.k = "k" * i
assert tag.valid?
end
def test_length_value_valid
tag = create(:old_node_tag)
- (0..255).each do |i|
+ [0, 255].each do |i|
tag.v = "v" * i
assert tag.valid?
end
class OldRelationTagTest < ActiveSupport::TestCase
def test_length_key_valid
tag = create(:old_relation_tag)
- (0..255).each do |i|
+ [0, 255].each do |i|
tag.k = "k" * i
assert tag.valid?
end
def test_length_value_valid
tag = create(:old_relation_tag)
- (0..255).each do |i|
+ [0, 255].each do |i|
tag.v = "v" * i
assert tag.valid?
end
class OldWayTagTest < ActiveSupport::TestCase
def test_length_key_valid
tag = create(:old_way_tag)
- (0..255).each do |i|
+ [0, 255].each do |i|
tag.k = "k" * i
assert tag.valid?
end
def test_length_value_valid
tag = create(:old_way_tag)
- (0..255).each do |i|
+ [0, 255].each do |i|
tag.v = "v" * i
assert tag.valid?
end
class RelationTagTest < ActiveSupport::TestCase
def test_length_key_valid
tag = create(:relation_tag)
- (0..255).each do |i|
+ [0, 255].each do |i|
tag.k = "k" * i
assert tag.valid?
end
def test_length_value_valid
tag = create(:relation_tag)
- (0..255).each do |i|
+ [0, 255].each do |i|
tag.v = "v" * i
assert tag.valid?
end
def test_check_valid_length
key = "k"
val = "v"
- (1..255).each do |i|
+ [1, 255].each do |i|
up = UserPreference.new
up.user = create(:user)
up.k = key * i
class WayTagTest < ActiveSupport::TestCase
def test_length_key_valid
tag = create(:way_tag)
- (0..255).each do |i|
+ [0, 255].each do |i|
tag.k = "k" * i
assert tag.valid?
end
def test_length_value_valid
tag = create(:way_tag)
- (0..255).each do |i|
+ [0, 255].each do |i|
tag.v = "v" * i
assert tag.valid?
end