Skip to content

Commit

Permalink
Actually test calling tuple-returning function
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyalIcing committed Dec 2, 2023
1 parent d610764 commit e14bf54
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 9 additions & 0 deletions lib/orb/instruction.ex
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ defmodule Orb.Instruction do
}
end

def new(type, operation, operands) when is_tuple(type) and is_list(operands) do
%__MODULE__{
type: type,
operation: operation,
# TODO: type check function.
operands: operands |> Enum.map(&Constants.expand_if_needed/1)
}
end

def wrap_constant!(type, value)

def wrap_constant!(Elixir.Integer, value) when is_number(value),
Expand Down
7 changes: 2 additions & 5 deletions test/orb_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -752,11 +752,8 @@ defmodule OrbTest do
(b + g + r) / 3.0
end

def main do
rgb_reverse(1.0, 0.5, 0.0)
:drop
:drop
:drop
defw main do
rgb_reverse(1.0, 0.5, 0.0) |> Orb.Stack.drop()
end
end

Expand Down

0 comments on commit e14bf54

Please sign in to comment.