Add bin and edit workflow
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s

This commit is contained in:
2026-09-16 13:11:16 -06:00
parent c8ac4fcae5
commit 4cee170d66
17576 changed files with 895740 additions and 2 deletions
@@ -0,0 +1,115 @@
covers 'facets/object/dup'
# TODO: Improve object/dup tests.
test_case Object do
setup "ordinary object" do
@o = Object.new
end
method :dup? do
test { assert @o.dup? }
end
method :clone? do
test { assert @o.clone? }
end
method :dup! do
test { assert @o.dup! }
end
method :try_dup do |o|
test { assert @o.try_dup }
end
end
test_case TrueClass do
method :dup? do
test { refute true.dup? }
end
method :clone? do
test { refute true.clone? }
end
method :dup! do
test { assert true.dup! }
end
method :try_dup do
test { assert true.try_dup }
end
end
test_case FalseClass do
method :dup? do
test { refute false.dup? }
end
method :clone? do
test { refute false.clone? }
end
method :dup! do
test { false.dup!.assert == false }
end
method :try_dup do
test { false.try_dup.assert == false }
end
end
test_case NilClass do
method :dup? do
test { refute nil.dup? }
end
method :clone? do
test { refute nil.clone? }
end
method :dup! do
test { nil.dup!.assert == nil }
end
method :try_dup do
test { nil.try_dup.assert == nil }
end
end
test_case Symbol do
method :dup? do
test { refute :a.dup? }
end
method :clone? do
test { refute :a.clone? }
end
method :dup! do
test { :a.dup!.assert == :a }
end
method :try_dup do
test { :a.try_dup.assert == :a }
end
end
test_case Numeric do
method :dup? do
test { refute 1.dup? }
end
method :clone? do
test { refute 1.clone? }
end
method :dup! do
test { 1.dup!.assert == 1 }
end
method :try_dup do
test { 1.try_dup.assert == 1 }
end
end
@@ -0,0 +1,75 @@
covers 'facets/object/object_state'
test_case Object do
method :object_state do
test do
c = Class.new do
def initialize(a,b)
@a, @b = a, b
end
end
o = c.new(1,2)
s = o.object_state
s.assert == {:a=>1, :b=>2}
end
end
end
test_case Struct do
method :object_state do
test do
c = Struct.new(:a, :b)
o = c.new(1,2)
s = o.object_state
s.assert == {:a=>1, :b=>2}
end
end
end
test_case Array do
method :object_state do
test do
a = [1,2,3,4]
s = a.object_state
s.assert == a
end
end
end
test_case Hash do
method :object_state do
test do
h = {:a=>1,:b=>2,:c=>3}
s = h.object_state
s.assert == h
end
end
end
test_case String do
method :object_state do
test do
t = "test string"
s = t.object_state
s.assert == t
end
end
end
#test_case Kernel do
#
# method :object_state do
# test do
# c = Class.new do
# def initialize(a,b)
# @a, @b = a, b
# end
# end
# o = c.new(1,2)
# s = o.object_state
# s.assert == {:a=>1, :b=>2}
# end
# end
#
#end
@@ -0,0 +1,59 @@
covers 'facets/object/try_dup'
test_case Object do
method :try_dup do
test do
obj1 = Object.new
obj2 = obj1.try_dup
obj2.equal?(obj1).assert == false
end
end
method :dup! do
test "is an alias for #try_dup" do
obj1 = Object.new
obj2 = obj1.dup!
obj2.equal?(obj1).assert == false
end
end
end
test_case TrueClass do
method :try_dup do
test do
true.try_dup.assert == true
end
end
end
test_case FalseClass do
method :try_dup do
test do
false.try_dup.assert == false
end
end
end
test_case NilClass do
method :try_dup do
test do
nil.try_dup.assert == nil
end
end
end
test_case Numeric do
method :try_dup do
test do
10.try_dup.assert == 10
end
end
end
test_case Symbol do
method :try_dup do
test do
:A.try_dup.assert == :A
end
end
end