Skip to content

Commit

Permalink
Added tests for binary data
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Mar 19, 2024
1 parent 7bca5a9 commit 969a402
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/adapters/mysql_test.rb
Expand Up @@ -92,6 +92,10 @@ def test_binary
run_statement "SELECT UNHEX('F6'), 1", format: "html"
end

def test_binary_output
assert_result [{"hello" => "0xF6"}], "SELECT UNHEX('F6') AS hello"
end

private

def prepared_statements?
Expand Down
4 changes: 4 additions & 0 deletions test/adapters/postgresql_test.rb
Expand Up @@ -67,4 +67,8 @@ def test_bad_position_after
def test_quoted
assert_error "could not determine data type of parameter $1", "SELECT '{var}' AS hello", var: "world"
end

def test_binary_output
assert_result [{"bytea" => "\\x68656c6c6f"}], "SELECT 'hello'::bytea"
end
end

0 comments on commit 969a402

Please sign in to comment.