gcode/test/support/fixture_helper.ex
James Harton ad8f6c44ef feat: Implement (a common subset) G-code parsing.
It turns out that G-code is a turing complete programming language. That was a surprise! I've implemented enough of the parser to be able to parse the output of Fusion 360 and Cura, both of which I use on a daily basis.  It is not a complete implementation.
2021-01-10 17:43:25 +13:00

17 lines
292 B
Elixir

defmodule FixtureHelper do
@moduledoc false
def read_fixture(name) do
name
|> fixture_path()
|> File.read!()
end
def fixture_path(name),
do:
:gcode
|> :code.priv_dir()
|> List.to_string()
|> Path.join("fixtures")
|> Path.join(name)
end