Skip to content

Commit

Permalink
remove invalid UTF-8 byte seqeunce tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ggmichaelgo committed Apr 12, 2024
1 parent 39eb562 commit a00b070
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ end

gemspec

gem "liquid", github: "Shopify/liquid", ref: "master"
gem "liquid", github: "Shopify/liquid", ref: "main"

group :test do
gem "base64", require: false # for older rubocop on Ruby 3.4
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GIT
remote: https://github.com/Shopify/liquid.git
revision: 0b9318222bcc09681e52fd5b8e70262274e673bf
ref: master
revision: 77bc56a1c28a707c2b222559ffb0b7b1c5588928
ref: main
specs:
liquid (5.4.0)
liquid (5.5.0)

PATH
remote: .
Expand Down
38 changes: 0 additions & 38 deletions test/unit/variable_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -286,44 +286,6 @@ def test_encoding_error_message_with_multi_byte_characters
)
end

def test_invalid_utf8_sequence
# 2 byte character with 1 byte missing
exc = assert_raises(ArgumentError) do
variable_strict_parse("\xC0")
end
assert_equal("invalid byte sequence in UTF-8", exc.message)

# 3 byte character with 1 byte missing
exc = assert_raises(ArgumentError) do
variable_strict_parse("\xE0\x01")
end
assert_equal("invalid byte sequence in UTF-8", exc.message)

# 3 byte character with 2 byte missing
exc = assert_raises(ArgumentError) do
variable_strict_parse("\xE0")
end
assert_equal("invalid byte sequence in UTF-8", exc.message)

# 4 byte character with 1 byte missing
exc = assert_raises(ArgumentError) do
variable_strict_parse("\xF0\x01\x01")
end
assert_equal("invalid byte sequence in UTF-8", exc.message)

# 4 byte character with 2 byte missing
exc = assert_raises(ArgumentError) do
variable_strict_parse("\xF0\x01")
end
assert_equal("invalid byte sequence in UTF-8", exc.message)

# 4 byte character with 3 byte missing
exc = assert_raises(ArgumentError) do
variable_strict_parse("\xF0")
end
assert_equal("invalid byte sequence in UTF-8", exc.message)
end

private

def variable_strict_parse(markup)
Expand Down

0 comments on commit a00b070

Please sign in to comment.