1
0
This repository has been archived on 2023-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
body_tracking/test/unit/formula_test.rb
2020-01-24 01:05:59 +01:00

29 lines
577 B
Ruby

require File.expand_path('../../test_helper', __FILE__)
class FormulaTest < ActiveSupport::TestCase
include BodyTracking::Formula
def setup
end
def test_builder_parses_valid_formulas_properly
vector = [
'4', Set[], [
{type: :indexed, content: '4*2'}
],
#'4*2'
#'Fats'
#'fats'
]
vector.each_slice(3) do |formula, identifiers, parts|
parser = FormulaBuilder.new(formula)
i, p = parser.parse
assert_empty parser.errors
assert_equal identifiers, i
assert_equal parts, p
end
end
end