test/sysv_mq_test.rb in sysvmq-0.1.1 vs test/sysv_mq_test.rb in sysvmq-0.2.0
- old
+ new
@@ -38,11 +38,11 @@
end
def test_sends_and_receives_utf8
message = "simån hørup"
@mq.send message
- assert_equal message, @mq.receive
+ assert_equal message, @mq.receive.force_encoding("UTF-8")
end
def test_sending_5_bytes_should_report_5_byte_queue
message = "B" * 5
@mq.send message
@@ -120,7 +120,13 @@
def test_string_key_and_gc
assert_raises TypeError do
SysVMQ.new("0xDEADC0DE", @size, SysVMQ::IPC_CREAT | 0666)
end
+ end
+
+ def test_null_bytes
+ message = "\x00omg\x00omg"
+ @mq.send(message)
+ assert_equal message, @mq.receive
end
end