Added support for mustache lambdas
Merge pull request #3 from bdolgov/master

Added support for mustache lambdas
Add tests from Mustache specification v1.1.2.

This adds a new test TestMustache::testConformance(). The test is
driven by JSON data from version 1.1.2 of the Mustache spec [1],
which has been copied to the tests/specs directory. The test is
only built when Qt 5.0.0+ is available, since it uses the JSON
classes.

I've tested that building with Qt 4.8.6 still works.

Unfortunately qt-mustache fails about half of the tests :( To see
the failures, uncomment the QEXPECT_FAIL(..) calls in the test. I
haven't looked into fixing any of these failures, but I think that
at least some of them shouldn't be too hard.

[1] https://github.com/mustache/spec
Add comment + spec link to testConformance().
Fail test case if opening JSON file fails.
Fix indentation.

qt-mustache uses tabs.
Allow whitespace between '=' and delimiter.

Currently, qt-mustache will not allow any whitespace between the =
signs and the start/end delimiter in set delimiter tags. It will
treat such whitespace as being part of the delimiters and yield the
error "Custom delimiters may not contain '=' or spaces.".

Apparently, even though the specification reads

    "The tag's content MUST be any two non-whitespace sequences
     (separated by whitespace) EXCEPT an equals sign ('=') followed
     by the current closing delimiter." [1],

apparently such whitespace should ignored. E.g. tags such as

    {{= [ ] =}}

should be allowed [2]. The spec is slightly ambiguos here I think,
but that is apparently the intention.

This patch changes `readSetDelimiter(..)` to ignore such whitespace.
As a result the "Pair with Padding" test case in `delimiters.json`
now passes, since it has such a set delimiter tag. The "Sections"
test case in the same file have one as well, and would also pass
now if we only handled standalone tags properly.

[1] https://github.com/mustache/spec/blob/v1.1.2/specs/delimiters.yml#L5-L7
[2] https://github.com/mustache/spec/issues/29
Merge pull request #4 from estan/master

Add tests from Mustache specification v1.1.2.
Allow whitespace between '=' and delimiter.

Currently, qt-mustache will not allow any whitespace between the =
signs and the start/end delimiter in set delimiter tags. It will
treat such whitespace as being part of the delimiters and yield the
error "Custom delimiters may not contain '=' or spaces.".

Apparently, even though the specification reads

    "The tag's content MUST be any two non-whitespace sequences
     (separated by whitespace) EXCEPT an equals sign ('=') followed
     by the current closing delimiter." [1],

apparently such whitespace should ignored. E.g. tags such as

    {{= [ ] =}}

should be allowed [2]. The spec is slightly ambiguos here I think,
but that is apparently the intention.

This patch changes `readSetDelimiter(..)` to ignore such whitespace.
As a result the "Pair with Padding" test case in `delimiters.json`
now passes, since it has such a set delimiter tag. The "Sections"
test case in the same file have one as well, and would also pass
now if we only handled standalone tags properly.

[1] https://github.com/mustache/spec/blob/v1.1.2/specs/delimiters.yml#L5-L7
[2] https://github.com/mustache/spec/issues/29
Merge branch 'spec-fixes' of github.com:estan/qt-mustache into spec-fixes
Merge pull request #6 from estan/spec-fixes

Spec fixes - Allow whitespace between '=' and start/end of delimiter when reading custom delimiters.
Fix falseyness of hashes/maps.

Hashes and maps are falsey only if they are empty. The current test
deemed QVariantHashes/-Maps as false if .toString().isEmpty(), which
is always true. This patch makes the test use the QHash::isEmpty()
and QMap::isEmpty() instead.

This fixes the "Context" tests in sections.json and inverted.json
(and also by "accident" the "Inverted Section" test in ~lambdas.json.
I'll fix so that the test doesn't even load tests from ~lambdas.json
in a separate commit.
Remove lambda spec tests.

The tests only have lambdas for perl/python/js/et.c. so they don't
even make sense for qt-mustache.
Don't let delimiters set in partial affect parent.

This fixes the "Post-Partial Behavior" test in delimiters.json.
Add .travis.yml file.

Only Qt 4 is available on 12.04 LTS that Travis runs. There are
PPAs with Qt 5 but they are not supported anymore. Once Travis is
on 14.04 LTS we can start testing on Qt 5 as well.
Forgot "make" command :)

*facepalm*.
Pass -spec linux-$CC to qmake.
Don't try to use clang at all.

That was probably a little too ambitious with Qt 4.
Add -qq to apt-get install command.
Use Qt 5 from Ubuntu SDK PPA.