summaryrefslogtreecommitdiffstats
path: root/spec/unit/parser
Commit message (Collapse)AuthorAgeFilesLines
...
| * Fix #1759 - Comparison operator was using string comparison for numbersBrice Figureau2008-11-201-10/+50
| | | | | | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * Move function existance test to parser evaluationBrice Figureau2008-11-171-0/+77
| | | | | | | | | | | | | | | | The aim is to let --parseonly succeeds even if the function is not (yet) present. This is usefull in commit-hooks and for the inline documentation generation system. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * RSpec tests for the doc system (covers AST.doc, lexer and parser)Brice Figureau2008-11-173-5/+121
| | | | | | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | Fixing a test broken by previous refactoringLuke Kanies2008-11-071-7/+4
|/ | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fix #1402 - Allow multiline commentsBrice Figureau2008-10-291-1/+29
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #857 - Multiple class of the same name don't append codeBrice Figureau2008-10-291-0/+28
| | | | | | | | | | | | | | | | | | | | The following manifest wasn't working: class one { notice('class one') } class one { notice('second class one') } include one It all boiled down to class code not being arrays. Encapsulating code in ASTArray when needed is enough to append code, because of the property of ASTArray to evaluate all their members in turn. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #1682 - ASTArray should flatten product of evaluation of its childrenBrice Figureau2008-10-291-0/+66
| | | | | If the ASTArray contains children that evaluate to arrays themselves, they aren't flattened.
* Fixed #1104 - Classes and nodes should set $name variablesBrice Figureau2008-10-281-0/+13
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixes #1663 - added Symbol check and additional testSean E. Millichamp2008-10-231-0/+9
|
* Fix #936 - Allow trailing comma in array definitionBrice Figureau2008-10-211-0/+8
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #1115 - part2 - fix tests and add all_tagsBrice Figureau2008-10-211-1/+7
| | | | | | | | Up until this patch, TemplateWrapper.tags was returning all the tags defined in the catalog. I think this is wrong and tags shoul only return the defined tags in the current scope. Hence, I defined a all_tags method that returns the list of tags defined in the whole catalog.
* Fixed #1663 - Regression relating to facter fact naming from 0.24.5James Turnbull2008-10-211-1/+14
|
* Fix #636 - Allow extraneous comma in function argument listBrice Figureau2008-10-211-0/+24
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #1115 - Allow checking tags/classes from ERb templatesBrice Figureau2008-10-141-0/+14
| | | | | | | | Add to predefined variables to the ERB template space. "classes" and "tags" which provide arrays of all the defined classes and tags for a node. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #1202 - Collection attribute matching doesn't parse arraysBrice Figureau2008-10-081-0/+92
| | | | | | | | | | | | This patch allows to do this: User <| groups == leads |> @user { "foo": ensure => "present", groups => ["bar","baz","leads"] } Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #1109 - allow empty if or else branchesBrice Figureau2008-10-072-0/+46
| | | | | | | | | | | | This changesets allow empty if or else branches: if true { } else { } It works by emitting on the parser stack an AST node that doesn't do anything (a no-op). This allows the less intrusive code as no part of the if evaluation code has been touched.
* Rspec Tests for #381.Brice Figureau2008-10-053-1/+154
| | | | Moved part of the old resource reference tests to rspec.
* Fixing #1098 - Multiline strings now correctly increment the line countLuke Kanies2008-10-041-0/+21
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Add parser for arbitrary expressionsBrice Figureau2008-10-012-4/+80
| | | | | | | | | | | | | | | | The expressions can be used in if 'test' and in the right side of assignements. The expressions can contain any number of sub-expressions combined by either arithmetic operators, comparison operators, or boolean operators. Random Usage Examples: $result = ((( $two + 2) / $one) + 4 * 5.45) - (6 << 7) + (0x800 + -9) or if ($a < 10) and ($a + 10 != 200) { ... }
* Add arithmetic operators to ASTBrice Figureau2008-09-303-0/+159
| | | | | This changeset adds +,-,/,*,<< and >> computation and AST parse nodes.
* Add not operator to ASTBrice Figureau2008-09-301-0/+30
|
* Add comparison operators (< > == != <= >=) to ASTBrice Figureau2008-09-301-0/+52
|
* Add boolean operators to ASTBrice Figureau2008-09-301-0/+53
|
* Fixed #1472 -- defined, exported resources in the current compile now get ↵Luke Kanies2008-09-251-5/+5
| | | | | | | | | expanded correctly. This was working for defined resources in the db, but not in the current compile. I just had to mark the resources as non-exported.
* Fixed #1045 - Multiple metaparams all get added to resources.Luke Kanies2008-09-241-0/+10
| | | | | | | The problem was that I was using a 'return' in a loop where I should have been using a 'next'. Signed-off-by: Luke Kanies <luke@madstop.com>
* Add rspec unit test for the append operatorBrice Figureau2008-09-214-1/+120
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixes #1274 - allow class names to start with numbersJames Turnbull2008-08-171-0/+9
|
* Added tests for TemplateWrapper's use of Scope#to_hash.Luke Kanies2008-08-091-1/+12
| | | | | | We should deprecate the method_missing stuff in 0.25. Signed-off-by: Luke Kanies <luke@madstop.com>
* Issue 1215Andrew Shafer2008-06-131-24/+3
| | | | | | Removed logic to reuse parser and log on server when there is a parsing error. Now we just make a new parser and if there is an error, raise it up, which will result in errors on the client logs.
* Fixing #1242 -- lack of storeconfigs only produces warning, not exception.Luke Kanies2008-05-261-0/+9
| | | | | Exporting or collecting resources no longer raises an exception when no storeconfigs is enabled, it just produces a warning.
* Correcting whitespace in the templatewrapper code.Luke Kanies2008-05-131-52/+52
| | | | Also slightly modified the wording of some of the tests.
* Adding has_variable? support, fixing ticket #1177Adam Jacob2008-05-131-0/+57
|
* Modified the 'master' handler to use the Catalog class toLuke Kanies2008-04-111-0/+7
| | | | | | | | | | compile node configurations, rather than using the Configuration handler, which was never used directly. I removed the Configuration handler as a result. Modified the 'master' handler (responsible for sending configurations to clients) to always return Time.now as its compile date, so configurations will always get recompiled.
* Fixes #1148 - replaces #!/usr/bin/ruby with #!/usr/bin/env ruby.Paul Lathrop2008-03-281-1/+1
|
* Fixing some tests that only failed under certainLuke Kanies2008-03-181-3/+1
| | | | | circumstances (mostly, when loaded with other files, or when loaded from rake or autotest rather than separately).
* Always duplicating resource defaults in the parser, so thatLuke Kanies2008-03-061-5/+156
| | | | | | stacked metaparameter values do not result in all resources that receive a given default also getting those stacked values.
* Fixing the fact that resources that model defined resourcesLuke Kanies2008-02-291-0/+6
| | | | | were getting finished multiple times, which meant they got multiple copies of metaparams.
* Fixed #1063 -- the master correctly logs syntax errors whenLuke Kanies2008-02-281-138/+148
| | | | reparsing during a single run.
* Fixing #1092 by no longer using the resource reference toLuke Kanies2008-02-281-2/+2
| | | | | | look resources up, which means there's no concern about not finding the resource, which is where the nil was coming from. We now just iterate over the vertices.
* Fixing #1085, I think -- I was not returning a resourceLuke Kanies2008-02-251-1/+7
| | | | | | if the class had already been evaluated, but this was only being run into in corner cases -- mostly where one class included another class, I assume.
* Fixing #1084 -- the node catalog asks the individualLuke Kanies2008-02-251-98/+113
| | | | | | resources whether they're isomorphic, and they in turn ask the resource types (or default to true for defined resource types).
* Fixed test for #1040James Turnbull2008-02-201-0/+1
|
* converting parser ast node specs from setup/teardown to before/afterRick Bradley2008-02-181-83/+81
|
* converting parser ast host class specs from setup/teardown to before/afterRick Bradley2008-02-181-86/+84
|
* converting parser compilerspecs from setup/teardown to before/afterRick Bradley2008-02-181-391/+379
|
* 'rake' within the spec dir works now, anyway, which isLuke Kanies2008-02-122-6/+6
| | | | a good start. Autotest still doesn't work, though.
* Fixed #997 -- virtual defined types are no longer evaluated.Luke Kanies2008-02-121-4/+13
| | | | | | | NOTE: This introduces a behaviour change, in that you previously could realize a resource within a virtual defined resource, and now you must realize the entire defined resource, rather than just the contained resource.
* Moving the ast node tests to rspec (which I could haveLuke Kanies2008-02-122-0/+275
| | | | | | | *sworn* I did this weekend). In the process, I fixed a couple of bugs related to differentiating between nodes and classes, and then cleaned up quite a few error messages.
* Changing the name of the Compile class to Compiler,Luke Kanies2008-02-117-188/+188
| | | | | since it's stupid to have a class named after a verb.
* Refactoring the interface between the Compile classLuke Kanies2008-02-111-26/+15
| | | | | and the AST::Node class to match that to the definitions and AST classes.