mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
fix bug related to Slice(T).new(0). It was messing with the data in the stack
This commit is contained in:
parent
b2da4f3f6e
commit
933014c1aa
2 changed files with 4 additions and 6 deletions
|
@ -170,8 +170,7 @@ describe DB do
|
|||
it "Foo and Bar drivers should return fake_row" do
|
||||
with_witness do |w|
|
||||
DB.open("foo://host") do |db|
|
||||
# TODO somehow FooValue.new(99) is needed otherwise the read_object assertion fail
|
||||
FooDriver.fake_row = [1, "string", FooValue.new(3), FooValue.new(99)] of FooDriver::Any
|
||||
FooDriver.fake_row = [1, "string", FooValue.new(3)] of FooDriver::Any
|
||||
db.query "query" do |rs|
|
||||
w.check
|
||||
rs.move_next
|
||||
|
@ -184,8 +183,7 @@ describe DB do
|
|||
|
||||
with_witness do |w|
|
||||
DB.open("bar://host") do |db|
|
||||
# TODO somehow BarValue.new(99) is needed otherwise the read_object assertion fail
|
||||
BarDriver.fake_row = [BarValue.new(4), "lorem", 1.0, BarValue.new(99)] of BarDriver::Any
|
||||
BarDriver.fake_row = [BarValue.new(4), "lorem", 1.0] of BarDriver::Any
|
||||
db.query "query" do |rs|
|
||||
w.check
|
||||
rs.move_next
|
||||
|
@ -199,7 +197,7 @@ describe DB do
|
|||
|
||||
it "drivers should return custom values as scalar" do
|
||||
DB.open("foo://host") do |db|
|
||||
FooDriver.fake_row = [FooValue.new(3), FooValue.new(99)] of FooDriver::Any
|
||||
FooDriver.fake_row = [FooValue.new(3)] of FooDriver::Any
|
||||
db.scalar("query").as(FooValue).value.should eq(3)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -54,7 +54,7 @@ module DB
|
|||
|
||||
# See `QueryMethods#query`
|
||||
def query
|
||||
perform_query Slice(Any).new(0)
|
||||
perform_query Tuple.new
|
||||
end
|
||||
|
||||
# See `QueryMethods#query`
|
||||
|
|
Loading…
Reference in a new issue