     assert %{} = SysCalls.get_sequence(TestSysCalls, 123)
     assert_receive {:get_sequence, [123]}
 
-    :ok = shim_fun_error(shim, "sequence not found")
+    :ok = simulate_syscall_error(shim, "sequence not found")
 
     assert {:error, "sequence not found"} ==
              SysCalls.get_sequence(TestSysCalls, 123)
   end
 
-  def shim_fun_ok(shim, val \\ :ok) do
+  def simulate_syscall(shim, val \\ :ok) do
     pid = self()
 
     :ok =


  test "get_sequence", %{shim: shim} do
    :ok =
      shim_fun_ok(shim, %AST{
        kind: :sequence,
        args: %{locals: %AST{kind: :scope_declaration, args: %{}}}
      })

  end

  test "point", %{shim: shim} do
    :ok = simulate_syscall(shim, %{x: 100, y: 200, z: 300})

    assert %{x: 100, y: 200, z: 300} =
             SysCalls.point(TestSysCalls, "Peripheral", 1)

    assert_receive {:point, ["Peripheral", 1]}

    :ok = simulate_syscall_error(shim, "point error")

    assert {:error, "point error"} ==
             SysCalls.point(TestSysCalls, "Peripheral", 1)
  end

  test "point groups", %{shim: shim} do
    :ok = simulate_syscall(shim, %{x: 100, y: 200, z: 300})

    assert %{x: 100, y: 200, z: 300} =
             SysCalls.point(TestSysCalls, "Peripheral", 1)

    assert_receive {:point, ["Peripheral", 1]}

    :ok = simulate_syscall_error(shim, "point error")

    assert {:error, "point error"} ==
             SysCalls.point(TestSysCalls, "Peripheral", 1)
  end

  test "move_absolute", %{shim: shim} do
    :ok = simulate_syscall(shim)
    assert :ok = SysCalls.move_absolute(TestSysCalls, 1, 2, 3, 4)
    assert_receive {:move_absolute, [1, 2, 3, 4]}

    :ok = simulate_syscall_error(shim, "move failed!")

    assert {:error, "move failed!"} ==
             SysCalls.move_absolute(TestSysCalls, 1, 2, 3, 4)
  end

  test "get current positions", %{shim: shim} do
    :ok = simulate_syscall(shim, 100.00)
    assert 100.00 = SysCalls.get_current_x(TestSysCalls)
    assert 100.00 = SysCalls.get_current_y(TestSysCalls)
    assert 100.00 = SysCalls.get_current_z(TestSysCalls)
