rename Equals to Eq
[scpubgit/DX.git] / t / 01basics.t
CommitLineData
2e93f662 1use strictures 2;
efad53c4 2use Test::More;
3use Module::Runtime qw(use_module);
1e812b19 4use DX::Utils qw(:builders deparse);
efad53c4 5
6my $ab = use_module('DX::ActionBuilder::UnsetValue')->new(
7 target_path => [ 0, 'X' ]
8);
9
10my $scope = use_module('DX::Scope')->new(
11 predicates => {
2e93f662 12 'eq' => use_module('DX::Predicate::Eq')->new,
efad53c4 13 member_at => use_module('DX::Predicate::MemberAt')->new,
14 is_dict => use_module('DX::Predicate::IsDict')->new,
15 },
16 globals => dict(),
17 locals => [
18 dict(
19 X => use_module('DX::Value::Unset')->new(
20 identity_path => [ 0, 'X' ],
21 action_builder => $ab,
22 ),
23 ),
24 ],
25);
26
27my $hyp = use_module('DX::Hypothesis')->new(
28 scope => $scope,
29 resolved_propositions => use_module('DX::ResolvedPropositionSet')->new_empty,
30 outstanding_propositions => [
31 proposition(is_dict => 'X'),
0498469a 32 proposition(member_at => 'X', string('a'), string('b')),
3e465d5d 33 #proposition(member_at => 'X', string('a'), string('c')),
34 proposition(eq => 'X', dict(a => string('b'), c => string('d'))),
efad53c4 35 ],
36 actions => [],
3e465d5d 37 action_policy => use_module('DX::ActionPolicy::Allow')->new
efad53c4 38);
39
40my $ss = use_module('DX::SearchState')->new(
41 current_hypothesis => $hyp,
42 alternatives => [],
43);
44
1e812b19 45#::Dwarn($ss->with_one_step->with_one_step);
39351e10 46warn deparse(my $f = $ss->with_one_step->with_one_step);
47warn deparse($f->with_one_step);
3e465d5d 48
39351e10 49#::Dwarn($f->current_hypothesis->resolved_propositions->dependency_map);