diff --git a/stdlib/pp/0/pp.rbs b/stdlib/pp/0/pp.rbs index 1ff8090d9f..c543439a5c 100644 --- a/stdlib/pp/0/pp.rbs +++ b/stdlib/pp/0/pp.rbs @@ -53,6 +53,11 @@ # Tanaka Akira # class PP < PrettyPrint + # + # The version string + # + VERSION: String + interface _PrettyPrint def pretty_print: (untyped q) -> untyped @@ -124,6 +129,14 @@ class PP < PrettyPrint # def pp: (_PrettyPrint obj) -> untyped + # + # A pretty print for a pair of Hash + # + def pp_hash_pair: (untyped k, untyped v) -> void + # + # The version number string. + # + VERSION: String # +# The error class for StringScanner. See StringScanner#unscan. +# +class StringScanner::Error < StandardError +end diff --git a/test/stdlib/PP_test.rb b/test/stdlib/PP_test.rb index 3068883396..b5f1562f6d 100644 --- a/test/stdlib/PP_test.rb +++ b/test/stdlib/PP_test.rb @@ -7,6 +7,10 @@ class PPSingletonTest < Test::Unit::TestCase library "pp" testing "singleton(::PP)" + def test_version + assert_const_type "String", "PP::VERSION" + end + def test_pp assert_send_type "(::PP::_PrettyPrint obj, ?::PP::_LeftShift out, ?::Integer width) -> untyped", PP, :pp, Object.new, ''.dup @@ -105,6 +109,11 @@ def test_pp_hash assert_send_type "(untyped obj) -> untyped", PP.new, :pp_hash, {} end + + def test_pp_hash_pair + assert_send_type "(untyped k, untyped v) -> void", + PP.new, :pp_hash_pair, :a, 1 + end end class PP::ObjectMixinTest < Test::Unit::TestCase diff --git a/test/stdlib/Shellwords_test.rb b/test/stdlib/Shellwords_test.rb index df593caaad..66ee9421cc 100644 --- a/test/stdlib/Shellwords_test.rb +++ b/test/stdlib/Shellwords_test.rb @@ -7,6 +7,10 @@ class ShellwordsSingletonTest < Test::Unit::TestCase library "shellwords" testing "singleton(::Shellwords)" + def test_version + assert_const_type "String", "Shellwords::VERSION" + end + def test_shellescape assert_send_type "(::String str) -> ::String", Shellwords, :shellescape, "shell" diff --git a/test/stdlib/StringScanner_test.rb b/test/stdlib/StringScanner_test.rb index 1a8b7cdce5..a5102980e3 100644 --- a/test/stdlib/StringScanner_test.rb +++ b/test/stdlib/StringScanner_test.rb @@ -18,6 +18,10 @@ def test_must_C_version assert_send_type "() -> singleton(::StringScanner)", StringScanner, :must_C_version end + + def test_error + assert_const_type "Class", "StringScanner::Error" + end end class StringScannerTest < Test::Unit::TestCase