 defmodule FarmbotCeleryScript.SysCallsTest do
   use ExUnit.Case, async: false
   use Mimic
-  alias FarmbotCeleryScript.{SysCalls, SysCalls.Stubs}
+
+  alias FarmbotCeleryScript.{
+    SysCalls,
+    SysCalls.Stubs,
+    AST
+  }
 
   test "point, OK" do
     expect(Stubs, :point, 1, fn _kind, 1 ->

  end

  test "set_servo_angle errors" do
    arg0 = [5, 40]
    assert :ok = SysCalls.set_servo_angle(Stubs, "set_servo_angle", arg0)
    assert_receive {:set_servo_angle, arg0}

    arg1 = [40, -5]

    assert {:error, "boom"} ==
             SysCalls.set_servo_angle(Stubs, "set_servo_angle", arg1)
  end

  test "get_sequence" do
    #   kind: :sequence,
    #   args: %{locals: %AST{kind: :scope_declaration, args: %{}}}
    # })
    assert %{} = SysCalls.get_sequence(Stubs, 123)
    assert_receive {:get_sequence, [123]}

    assert {:error, "sequence not found"} ==
             SysCalls.get_sequence(Stubs, 123)
  end
end

  end

  test "wait" do
    expect(Stubs, :wait, fn ms ->
      if ms == 1000 do
        :ok
      end
    end)

    assert :ok = SysCalls.wait(Stubs, 1000)
  end

  test "named_pin" do
