cauldron 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +2 -1
- data/VERSION +1 -1
- data/features/cauldron_generates_runtime_method.feature +2 -2
- data/lib/Chain.rb +22 -6
- data/lib/UnifiedChain.rb +17 -2
- data/lib/cauldron.rb +3 -0
- data/lib/cauldron/pot.rb +50 -40
- data/lib/cauldron/terminal.rb +2 -2
- data/lib/core/ClassMethodCallContainer.rb +0 -1
- data/lib/core/MethodUsage.rb +0 -1
- data/lib/core/TheoryGenerator.rb +0 -4
- data/lib/core/runtime_method/RuntimeMethod.rb +1 -1
- data/lib/core/statement/ActsAsStatement.rb +1 -1
- data/lib/core/statement/Statement.rb +65 -146
- data/lib/core/statement/TheoryStatement.rb +1 -0
- data/lib/core/variable/FixnumVariable.rb +4 -5
- data/lib/core/variable/Unknown.rb +1 -11
- data/lib/core/variable/Variable.rb +1 -1
- data/lib/required.rb +0 -1
- data/lib/ruby_code/String.rb +0 -6
- data/lib/theory/TheoryConnector.rb +54 -117
- data/lib/util/ClassEvaluation.rb +9 -28
- data/lib/util/CodeEvaluation.rb +22 -18
- data/lib/util/DeclarationStatementEvaluation.rb +4 -3
- data/lib/util/MethodEvaluation.rb +6 -6
- data/lib/util/StatementCheck.rb +5 -3
- data/lib/util/StringToTheory.rb +0 -1
- data/spec/cauldron/pot_spec.rb +40 -0
- data/test/fixtures/theories/0/dump +0 -0
- data/test/fixtures/theories/1/dump +0 -0
- data/test/fixtures/theories/10/dump +0 -0
- data/test/fixtures/theories/11/dump +0 -0
- data/test/fixtures/theories/12/dump +0 -0
- data/test/fixtures/theories/13/dump +0 -0
- data/test/fixtures/theories/14/dump +0 -0
- data/test/fixtures/theories/15/dump +0 -0
- data/test/fixtures/theories/16/dump +0 -0
- data/test/fixtures/theories/17/dump +0 -0
- data/test/fixtures/theories/18/dump +0 -0
- data/test/fixtures/theories/19/dump +0 -0
- data/test/fixtures/theories/2/dump +0 -0
- data/test/fixtures/theories/20/dump +0 -0
- data/test/fixtures/theories/3/dump +0 -0
- data/test/fixtures/theories/4/dump +0 -0
- data/test/fixtures/theories/5/dump +0 -0
- data/test/fixtures/theories/6/dump +0 -0
- data/test/fixtures/theories/7/dump +0 -0
- data/test/fixtures/theories/8/dump +0 -0
- data/test/fixtures/theories/9/declaration.txt +1 -1
- data/test/fixtures/theories/9/desc +1 -1
- data/test/fixtures/theories/9/dump +0 -0
- data/test/ts_complete.rb +0 -1
- data/test/unit/core/runtime_method/tc_runtime_method.rb +0 -25
- data/test/unit/core/statement/tc_statement.rb +0 -52
- data/test/unit/core/tc_theory_generator.rb +2 -2
- data/test/unit/tc_theory.rb +2 -10
- data/test/unit/theory/tc_theory_action.rb +2 -6
- data/test/unit/util/tc_string_to_theory.rb +2 -2
- data/tmp/runtime_method_evaluation.rb +10 -7
- metadata +28 -30
- data/lib/core/runtime_class/IfStatementClass.rb +0 -12
- data/test/tc_contextual_variables.rb +0 -48
@@ -1,48 +0,0 @@
|
|
1
|
-
# This meant to test that the variables requirements change to reflect
|
2
|
-
# the context they are accessed.
|
3
|
-
#
|
4
|
-
|
5
|
-
# TODO This can go!
|
6
|
-
|
7
|
-
require 'required'
|
8
|
-
require 'test/unit'
|
9
|
-
|
10
|
-
class TestContextualVariable < Test::Unit::TestCase
|
11
|
-
|
12
|
-
def setup
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
def teardown
|
17
|
-
System.reset
|
18
|
-
RuntimeMethod.reset_global_id
|
19
|
-
end
|
20
|
-
|
21
|
-
# This test checks the the declared variable in the following statement
|
22
|
-
#
|
23
|
-
# varA = varB-varC
|
24
|
-
#
|
25
|
-
# has the contextual requirement
|
26
|
-
#
|
27
|
-
# self = varB-varC
|
28
|
-
#
|
29
|
-
def test_declared_variables_in_statement_with_multiple_variables
|
30
|
-
|
31
|
-
# Create the statement
|
32
|
-
declared_variable = Unknown.new
|
33
|
-
varB = Unknown.new
|
34
|
-
varC = Unknown.new
|
35
|
-
statement = Statement.new(declared_variable,Equal.new,varB,Subtract.new,varC)
|
36
|
-
|
37
|
-
# Check the number of elmements in the statement
|
38
|
-
assert_equal(5,statement.length)
|
39
|
-
|
40
|
-
# Retrieve the contextual declared variable
|
41
|
-
contextual_variable = statement.contextual_variable(declared_variable.variable_id)
|
42
|
-
|
43
|
-
# Confirm a variable was returned
|
44
|
-
assert(contextual_variable.kind_of?(Variable))
|
45
|
-
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|