Merge pull request #235 from scelis/fix/234_complex_placeholders

Fix an error caused by combining %@ with other placeholders
This commit is contained in:
Sebastian Celis 2018-01-26 11:39:42 -06:00 committed by GitHub
commit 15006424ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -24,7 +24,7 @@ module Twine
# %@ -> %s
value = convert_twine_string_placeholder(input)
number_of_placeholders = number_of_twine_placeholders(input)
number_of_placeholders = number_of_twine_placeholders(value)
return value if number_of_placeholders == 0

View file

@ -79,6 +79,10 @@ class PlaceholderTest < TwineTest
to_android("some %d second %2$f")
end
end
def test_complicated_float_placeholders
assert_equal "%1$.0f%2$s (apparent: %3$.0f)", to_android("%.0f%@ (apparent: %.0f)")
end
end
class FromAndroid < PlaceholderTest