зеркало из https://github.com/github/ruby.git
Родитель
b9ea83fc1c
Коммит
ee7a338d2b
4
pack.c
4
pack.c
|
@ -167,8 +167,8 @@ unknown_directive(const char *mode, char type, VALUE fmt)
|
|||
snprintf(unknown, sizeof(unknown), "\\x%.2x", type & 0xff);
|
||||
}
|
||||
fmt = rb_str_quote_unprintable(fmt);
|
||||
rb_warning("unknown %s directive '%s' in '%"PRIsVALUE"'",
|
||||
mode, unknown, fmt);
|
||||
rb_warn("unknown %s directive '%s' in '%"PRIsVALUE"'",
|
||||
mode, unknown, fmt);
|
||||
}
|
||||
|
||||
static float
|
||||
|
|
|
@ -777,21 +777,13 @@ EXPECTED
|
|||
end
|
||||
|
||||
def test_pack_garbage
|
||||
assert_warn("") do
|
||||
assert_equal "\000", [0].pack("*U")
|
||||
end
|
||||
|
||||
assert_warning(%r%unknown pack directive '\*' in '\*U'$%) do
|
||||
assert_warn(%r%unknown pack directive '\*' in '\*U'$%) do
|
||||
assert_equal "\000", [0].pack("*U")
|
||||
end
|
||||
end
|
||||
|
||||
def test_unpack_garbage
|
||||
assert_warn("") do
|
||||
assert_equal [0], "\000".unpack("*U")
|
||||
end
|
||||
|
||||
assert_warning(%r%unknown unpack directive '\*' in '\*U'$%) do
|
||||
assert_warn(%r%unknown unpack directive '\*' in '\*U'$%) do
|
||||
assert_equal [0], "\000".unpack("*U")
|
||||
end
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче