summaryrefslogtreecommitdiffstats
path: root/debian/vendor-h2o/deps/mruby-errno/test/errno.rb
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 21:12:02 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 21:12:02 +0000
commit77e50caaf2ef81cd91075cf836fed0e75718ffb4 (patch)
tree53b7b411290b63192fc9e924a3b6b65cdf67e9d0 /debian/vendor-h2o/deps/mruby-errno/test/errno.rb
parentAdding upstream version 1.8.3. (diff)
downloaddnsdist-77e50caaf2ef81cd91075cf836fed0e75718ffb4.tar.xz
dnsdist-77e50caaf2ef81cd91075cf836fed0e75718ffb4.zip
Adding debian version 1.8.3-2.debian/1.8.3-2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/vendor-h2o/deps/mruby-errno/test/errno.rb')
-rw-r--r--debian/vendor-h2o/deps/mruby-errno/test/errno.rb60
1 files changed, 60 insertions, 0 deletions
diff --git a/debian/vendor-h2o/deps/mruby-errno/test/errno.rb b/debian/vendor-h2o/deps/mruby-errno/test/errno.rb
new file mode 100644
index 0000000..7903115
--- /dev/null
+++ b/debian/vendor-h2o/deps/mruby-errno/test/errno.rb
@@ -0,0 +1,60 @@
+assert('Errno') do
+ Errno.class == Module
+end
+
+assert('SystemCallError') do
+ SystemCallError.class == Class
+end
+
+assert('SystemCallError superclass') do
+ SystemCallError.superclass == StandardError
+end
+
+assert('SystemCallError#initialize') do
+ SystemCallError.new("a").message == "unknown error - a" and
+ SystemCallError.new("a", 12345).message == "Unknown error: 12345 - a" and
+ SystemCallError.new(12345).message == "Unknown error: 12345"
+end
+
+assert('SystemCallError#errno') do
+ assert_equal 1, SystemCallError.new("a", 1).errno
+ assert_equal 1, SystemCallError.new(1).errno
+ assert_equal 12345, SystemCallError.new("a", 12345).errno
+ assert_equal 23456, SystemCallError.new(23456).errno
+end
+
+assert('SystemCallError#inspect') do
+ SystemCallError.new("a").inspect == "SystemCallError: unknown error - a"
+ end
+
+assert('Errno::NOERROR') do
+ Errno::NOERROR.class == Class
+end
+
+# Is there any platform does not have EPERM?
+assert('Errno::EPERM') do
+ Errno::EPERM.class == Class
+end
+
+assert('Errno::EPERM superclass') do
+ Errno::EPERM.superclass == SystemCallError
+end
+
+assert('Errno::EPERM::Errno') do
+ Errno::EPERM::Errno.is_a? Fixnum
+end
+
+assert('Errno::EPERM#message') do
+ msg = Errno::EPERM.new.message
+ Errno::EPERM.new("a").message == "#{msg} - a"
+end
+
+assert('Errno::EPERM#inspect 1') do
+ msg = Errno::EPERM.new.message
+ Errno::EPERM.new.inspect == "Errno::EPERM: #{msg}"
+end
+
+assert('Errno::EPERM#inspect 2') do
+ msg = Errno::EPERM.new.message
+ Errno::EPERM.new("a").inspect == "Errno::EPERM: #{msg} - a"
+end