redsnow 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +67 -0
- data/Rakefile +1 -1
- data/doc/RedSnow.html +321 -0
- data/doc/RedSnow/Action.html +702 -0
- data/doc/RedSnow/Binding.html +135 -0
- data/doc/RedSnow/Blueprint.html +657 -0
- data/doc/RedSnow/BlueprintNode.html +139 -0
- data/doc/RedSnow/ErrorCodes.html +165 -0
- data/doc/RedSnow/Headers.html +456 -0
- data/doc/RedSnow/KeyValueCollection.html +343 -0
- data/doc/RedSnow/Location.html +391 -0
- data/doc/RedSnow/Metadata.html +343 -0
- data/doc/RedSnow/NamedBlueprintNode.html +444 -0
- data/doc/RedSnow/Object.html +295 -0
- data/doc/RedSnow/Parameter.html +881 -0
- data/doc/RedSnow/Parameters.html +349 -0
- data/doc/RedSnow/ParseResult.html +570 -0
- data/doc/RedSnow/Payload.html +775 -0
- data/doc/RedSnow/Resource.html +790 -0
- data/doc/RedSnow/ResourceGroup.html +521 -0
- data/doc/RedSnow/TransactionExample.html +700 -0
- data/doc/RedSnow/WarningCodes.html +210 -0
- data/doc/_index.html +342 -0
- data/doc/class_list.html +54 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +339 -0
- data/doc/file.README.html +136 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +136 -0
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +178 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +347 -0
- data/doc/top-level-namespace.html +112 -0
- data/ext/snowcrash/Gemfile +8 -0
- data/ext/snowcrash/Gemfile.lock +40 -0
- data/ext/snowcrash/LICENSE +22 -0
- data/ext/snowcrash/README.md +118 -0
- data/ext/snowcrash/bin/snowcrash +0 -0
- data/ext/snowcrash/bin/test-libsnowcrash +0 -0
- data/ext/snowcrash/build/Makefile +375 -0
- data/ext/snowcrash/build/gyp-mac-tool +511 -0
- data/ext/snowcrash/build/libmarkdownparser.target.mk +137 -0
- data/ext/snowcrash/build/libsnowcrash.target.mk +165 -0
- data/ext/snowcrash/build/libsundown.target.mk +143 -0
- data/ext/snowcrash/build/out/Release/libmarkdownparser.a +0 -0
- data/ext/snowcrash/build/out/Release/libsnowcrash.dylib +0 -0
- data/ext/snowcrash/build/out/Release/libsundown.a +0 -0
- data/ext/snowcrash/build/out/Release/linker.lock +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libmarkdownparser/ext/markdown-parser/src/ByteBuffer.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libmarkdownparser/ext/markdown-parser/src/MarkdownNode.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libmarkdownparser/ext/markdown-parser/src/MarkdownParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/CBlueprint.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/CBlueprintSourcemap.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/CSourceAnnotation.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/HTTP.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/MarkdownBlock.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/MarkdownParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/Parser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/ParserCore.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/Section.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/Serialize.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/SerializeJSON.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/SerializeYAML.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/Signature.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/UriTemplateParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/csnowcrash.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/posix/RegexMatch.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsnowcrash/src/snowcrash.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/html/houdini_href_e.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/html/houdini_html_e.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/html/html.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/html/html_smartypants.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/src/autolink.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/src/buffer.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/src/markdown.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/src/src_map.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/libsundown/ext/markdown-parser/ext/sundown/src/stack.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/snowcrash/src/snowcrash/snowcrash.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/sundown/sundown/html/houdini_href_e.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/sundown/sundown/html/houdini_html_e.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/sundown/sundown/html/html.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/sundown/sundown/html/html_smartypants.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/sundown/sundown/src/autolink.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/sundown/sundown/src/buffer.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/sundown/sundown/src/markdown.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/sundown/sundown/src/src_map.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/sundown/sundown/src/stack.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-ActionParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-AssetParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-Blueprint.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-BlueprintParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-HeaderParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-HeadersParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-Indentation.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-ListUtility.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-MarkdownBlock.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-MarkdownParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-ParameterDefinitonParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-ParameterParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-ParametersParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-Parser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-PayloadParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-RegexMatch.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-ResouceGroupParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-ResourceGroupParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-ResourceParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-SectionParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-SymbolIdentifier.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-SymbolTable.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-UriTemplateParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-ValuesParser.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-Warnings.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-csnowcrash.o +0 -0
- data/ext/snowcrash/build/out/Release/obj.target/test-libsnowcrash/test/test-snowcrash.o +0 -0
- data/ext/snowcrash/build/out/Release/snowcrash +0 -0
- data/ext/snowcrash/build/out/Release/test-libsnowcrash +0 -0
- data/ext/snowcrash/build/perf-libsnowcrash.target.mk +151 -0
- data/ext/snowcrash/build/snowcrash.Makefile +6 -0
- data/ext/snowcrash/build/snowcrash.target.mk +149 -0
- data/ext/snowcrash/build/sundown.target.mk +143 -0
- data/ext/snowcrash/build/test-libsnowcrash.target.mk +170 -0
- data/ext/snowcrash/ext/cmdline/LICENSE +30 -0
- data/ext/snowcrash/ext/cmdline/README.rst +191 -0
- data/ext/snowcrash/ext/cmdline/cmdline.h +817 -0
- data/ext/snowcrash/ext/cmdline/test.cpp +50 -0
- data/ext/snowcrash/ext/cmdline/test2.cpp +61 -0
- data/ext/snowcrash/ext/markdown-parser/LICENSE +22 -0
- data/ext/snowcrash/ext/markdown-parser/README.md +11 -0
- data/ext/snowcrash/ext/markdown-parser/ext/sundown/README.markdown +141 -0
- data/ext/snowcrash/ext/markdown-parser/markdownparser.xcodeproj/project.pbxproj +448 -0
- data/ext/snowcrash/ext/markdown-parser/msvc/test-markdown/test-markdown.vcproj +195 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/LICENSE_1_0.txt +23 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/README.md +24 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/catch-logo-small.png +0 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/assertions.md +64 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/build-systems.md +36 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/command-line.md +155 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/contributing.md +19 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/logging.md +52 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/own-main.md +68 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/reference-index.md +14 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/test-cases-and-sections.md +60 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/test-fixtures.md +32 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/tutorial.md +228 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/whats-changed.md +24 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/docs/why-catch.md +42 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/catch.hpp +202 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/catch_runner.hpp +224 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/catch_with_main.hpp +15 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/external/clara.h +868 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/external/tbc_text_format.h +153 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_approx.hpp +91 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_assertionresult.h +71 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_assertionresult.hpp +91 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_capture.hpp +179 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_clara.h +32 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_commandline.hpp +145 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_common.h +119 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_common.hpp +86 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_compiler_capabilities.h +123 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_config.hpp +178 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_console_colour.hpp +66 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_console_colour_impl.hpp +166 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_context.h +53 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_context_impl.hpp +112 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_debugger.h +49 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_debugger.hpp +100 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_default_main.hpp +38 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_evaluate.hpp +178 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_exception_translator_registry.hpp +75 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_expression_decomposer.hpp +31 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_expression_lhs.hpp +105 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_expressionresult_builder.h +63 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_expressionresult_builder.hpp +98 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_generators.hpp +190 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_generators_impl.hpp +86 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_impl.hpp +92 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_interfaces_capture.h +46 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_interfaces_config.h +54 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_interfaces_exception.h +66 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_interfaces_generators.h +32 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_interfaces_registry_hub.h +44 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_interfaces_reporter.h +265 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_interfaces_runner.h +19 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_interfaces_testcase.h +37 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_legacy_reporter_adapter.h +59 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_legacy_reporter_adapter.hpp +82 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_list.hpp +150 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_matchers.hpp +233 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_message.h +65 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_message.hpp +43 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_notimplemented_exception.h +35 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_notimplemented_exception.hpp +30 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_objc.hpp +203 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_objc_arc.hpp +51 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_option.hpp +75 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_platform.h +20 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_ptr.hpp +94 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_registry_hub.hpp +83 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_reporter_registrars.hpp +74 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_reporter_registry.hpp +45 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_result_type.h +66 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_runner_impl.hpp +319 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_section.h +55 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_section.hpp +40 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_section_info.h +31 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_section_info.hpp +113 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_sfinae.hpp +44 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_stream.h +33 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_stream.hpp +83 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_streambuf.h +23 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_tags.h +109 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_tags.hpp +137 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_test_case_info.h +84 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_test_case_info.hpp +166 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_test_case_registry_impl.hpp +146 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_test_case_tracker.hpp +148 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_test_registry.hpp +120 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_test_spec.h +65 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_test_spec.hpp +133 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_text.h +24 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_timer.h +35 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_timer.hpp +63 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_tostring.hpp +276 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_totals.hpp +67 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_version.h +37 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_version.hpp +19 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/internal/catch_xmlwriter.hpp +218 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/reporters/catch_reporter_bases.hpp +203 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/reporters/catch_reporter_console.hpp +411 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/reporters/catch_reporter_junit.hpp +226 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/include/reporters/catch_reporter_xml.hpp +151 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/CMake/CMakeLists.txt +38 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/ApproxTests.cpp +112 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/BDDTests.cpp +68 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/Baselines/console.std.approved.txt +778 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/Baselines/console.sw.approved.txt +6995 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/Baselines/console.swa4.approved.txt +322 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/Baselines/junit.sw.approved.txt +562 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/Baselines/xml.sw.approved.txt +7251 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/ClassTests.cpp +57 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/ConditionTests.cpp +334 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/ExceptionTests.cpp +153 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/GeneratorTests.cpp +42 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/MessageTests.cpp +121 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/MiscTests.cpp +341 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SectionTrackerTests.cpp +164 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_common.cpp +2 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_console_colour.cpp +2 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_debugger.cpp +2 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_capture.cpp +2 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_config.cpp +1 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_exception.cpp +1 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_generators.cpp +1 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_registry_hub.cpp +2 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_reporter.cpp +1 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_runner.cpp +1 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_testcase.cpp +1 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_message.cpp +2 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_option.cpp +2 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_ptr.cpp +2 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_stream.cpp +2 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_streambuf.cpp +2 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_tags.cpp +2 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/SurrogateCpps/catch_xmlwriter.cpp +2 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/TestMain.cpp +541 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/TrickyTests.cpp +396 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/VariadicMacrosTests.cpp +31 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/SelfTest/makefile +21 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/VS2008/TestCatch/TestCatch.sln +20 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/VS2008/TestCatch/TestCatch/TestCatch.cpp +8 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/VS2008/TestCatch/TestCatch/TestCatch.vcproj +394 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/VS2010/TestCatch/TestCatch.sln +20 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/VS2010/TestCatch/TestCatch/TestCatch.vcxproj +148 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +685 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/CatchSelfTest/CatchSelfTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/CatchSelfTest/CatchSelfTest.xcodeproj/project.xcworkspace/xcshareddata/CatchSelfTest.xccheckout +41 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/CatchSelfTest/CatchSelfTest/CatchSelfTest.1 +79 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/CatchSelfTest/CatchSelfTest/catch_text.cpp +2 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/CatchSelfTest/CatchSelfTestSingle.xcodeproj/project.pbxproj +258 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/CatchSelfTest/CatchSelfTestSingle.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/CatchSelfTest/CatchSelfTestSingle.xcodeproj/project.xcworkspace/xcshareddata/CatchSelfTestSingle.xccheckout +41 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/CatchSelfTest/CatchSelfTestSingle/dummy.txt +0 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/OCTest/OCTest.xcodeproj/project.pbxproj +265 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/OCTest/OCTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/OCTest/OCTest.xcodeproj/project.xcworkspace/xcshareddata/OCTest.xccheckout +41 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/OCTest/OCTest/CatchOCTestCase.h +25 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/OCTest/OCTest/CatchOCTestCase.mm +83 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/OCTest/OCTest/Main.mm +2 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/OCTest/OCTest/OCTest.1 +79 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/OCTest/OCTest/OCTest.mm +28 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/OCTest/OCTest/TestObj.h +28 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/OCTest/OCTest/TestObj.m +25 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/iOSTest/iOSTest.xcodeproj/project.pbxproj +299 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/iOSTest/iOSTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/iOSTest/iOSTest/OCTest.mm +27 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/iOSTest/iOSTest/TestObj.h +25 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/iOSTest/iOSTest/TestObj.m +18 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/iOSTest/iOSTest/en.lproj/InfoPlist.strings +2 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/iOSTest/iOSTest/iOSTest-Info.plist +47 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/XCode/iOSTest/iOSTest/iOSTest-Prefix.pch +14 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/runners/iTchRunner/internal/iTchRunnerAppDelegate.h +114 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/runners/iTchRunner/internal/iTchRunnerMainView.h +189 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/runners/iTchRunner/internal/iTchRunnerReporter.h +115 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/runners/iTchRunner/itChRunnerMain.mm +27 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/projects/runners/iTchRunner/readme +6 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/scripts/approvalTests.py +99 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/scripts/approve.py +29 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/scripts/generateSingleHeader.py +152 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/scripts/scriptCommon.py +4 -0
- data/ext/snowcrash/ext/markdown-parser/test/ext/Catch/single_include/catch.hpp +8544 -0
- data/ext/snowcrash/ext/markdown-parser/test/test-ByteBuffer.cc +83 -0
- data/ext/snowcrash/ext/markdown-parser/test/test-MarkdownParser.cc +628 -0
- data/ext/snowcrash/ext/markdown-parser/test/test-libmarkdownparser.cc +10 -0
- data/ext/snowcrash/features/fixtures/ast.json +154 -0
- data/ext/snowcrash/features/fixtures/ast.yaml +87 -0
- data/ext/snowcrash/features/fixtures/blueprint.apib +84 -0
- data/ext/snowcrash/features/fixtures/invalid_blueprint.apib +4 -0
- data/ext/snowcrash/features/parse.feature +23 -0
- data/ext/snowcrash/features/step_definitions/file_content_step.rb +8 -0
- data/ext/snowcrash/features/support/env.rb +7 -0
- data/ext/snowcrash/features/support/setup.rb +1 -0
- data/ext/snowcrash/features/validate.feature +37 -0
- data/ext/snowcrash/features/version.feature +10 -0
- data/ext/snowcrash/snowcrash.xcodeproj/project.pbxproj +798 -0
- data/ext/snowcrash/test/README.md +7 -0
- data/ext/snowcrash/test/performance/fixtures/fixture-1.apib +174 -0
- data/ext/snowcrash/test/performance/fixtures/fixture-2.apib +2455 -0
- data/ext/snowcrash/test/performance/fixtures/fixture-3.apib +10363 -0
- data/ext/snowcrash/test/performance/fixtures/fixture-4.apib +8390 -0
- data/ext/snowcrash/test/performance/perf-snowcrash.cc +162 -0
- data/ext/snowcrash/test/snowcrashtest.h +88 -0
- data/ext/snowcrash/test/test-ActionParser.cc +491 -0
- data/ext/snowcrash/test/test-AssetParser.cc +224 -0
- data/ext/snowcrash/test/test-Blueprint.cc +32 -0
- data/ext/snowcrash/test/test-BlueprintParser.cc +462 -0
- data/ext/snowcrash/test/test-HeadersParser.cc +256 -0
- data/ext/snowcrash/test/test-Indentation.cc +336 -0
- data/ext/snowcrash/test/test-ParameterParser.cc +499 -0
- data/ext/snowcrash/test/test-ParametersParser.cc +355 -0
- data/ext/snowcrash/test/test-PayloadParser.cc +657 -0
- data/ext/snowcrash/test/test-RegexMatch.cc +35 -0
- data/ext/snowcrash/test/test-ResourceGroupParser.cc +457 -0
- data/ext/snowcrash/test/test-ResourceParser.cc +947 -0
- data/ext/snowcrash/test/test-SectionParser.cc +81 -0
- data/ext/snowcrash/test/test-StringUtility.cc +65 -0
- data/ext/snowcrash/test/test-SymbolIdentifier.cc +53 -0
- data/ext/snowcrash/test/test-SymbolTable.cc +31 -0
- data/ext/snowcrash/test/test-UriTemplateParser.cc +333 -0
- data/ext/snowcrash/test/test-ValuesParser.cc +106 -0
- data/ext/snowcrash/test/test-Warnings.cc +94 -0
- data/ext/snowcrash/test/test-csnowcrash.cc +404 -0
- data/ext/snowcrash/test/test-snowcrash.cc +664 -0
- data/ext/snowcrash/test/vendor/Catch/LICENSE_1_0.txt +23 -0
- data/ext/snowcrash/test/vendor/Catch/README.md +24 -0
- data/ext/snowcrash/test/vendor/Catch/catch-logo-small.png +0 -0
- data/ext/snowcrash/test/vendor/Catch/docs/assertions.md +59 -0
- data/ext/snowcrash/test/vendor/Catch/docs/command-line.md +137 -0
- data/ext/snowcrash/test/vendor/Catch/docs/logging.md +52 -0
- data/ext/snowcrash/test/vendor/Catch/docs/own-main.md +68 -0
- data/ext/snowcrash/test/vendor/Catch/docs/reference-index.md +13 -0
- data/ext/snowcrash/test/vendor/Catch/docs/test-fixtures.md +32 -0
- data/ext/snowcrash/test/vendor/Catch/docs/tutorial.md +100 -0
- data/ext/snowcrash/test/vendor/Catch/docs/whats-changed.md +24 -0
- data/ext/snowcrash/test/vendor/Catch/docs/why-catch.md +42 -0
- data/ext/snowcrash/test/vendor/Catch/include/catch.hpp +182 -0
- data/ext/snowcrash/test/vendor/Catch/include/catch_runner.hpp +236 -0
- data/ext/snowcrash/test/vendor/Catch/include/catch_with_main.hpp +15 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_approx.hpp +91 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_assertionresult.h +65 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_assertionresult.hpp +91 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_capture.hpp +175 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_commandline.hpp +129 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_common.h +148 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_compiler_capabilities.h +85 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_config.hpp +182 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_console_colour.hpp +66 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_console_colour_impl.hpp +153 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_context.h +53 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_context_impl.hpp +112 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_debugger.hpp +116 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_default_main.hpp +38 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_evaluate.hpp +178 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_exception_translator_registry.hpp +74 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_expression_decomposer.hpp +31 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_expression_lhs.hpp +97 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_expressionresult_builder.h +63 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_expressionresult_builder.hpp +98 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_generators.hpp +190 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_generators_impl.hpp +86 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_impl.hpp +97 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_interfaces_capture.h +46 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_interfaces_config.h +32 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_interfaces_exception.h +66 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_interfaces_generators.h +32 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_interfaces_registry_hub.h +45 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_interfaces_reporter.h +339 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_interfaces_runner.h +23 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_interfaces_testcase.h +34 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_legacy_reporter_adapter.h +39 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_legacy_reporter_adapter.hpp +84 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_list.hpp +198 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_matchers.hpp +233 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_message.h +65 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_message.hpp +43 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_notimplemented_exception.h +35 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_notimplemented_exception.hpp +30 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_objc.hpp +202 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_objc_arc.hpp +51 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_option.hpp +67 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_ptr.hpp +94 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_registry_hub.hpp +83 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_reporter_registrars.hpp +75 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_reporter_registry.hpp +45 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_result_type.h +66 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_runner_impl.hpp +326 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_running_test.hpp +117 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_section.hpp +56 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_section_info.hpp +113 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_sfinae.hpp +44 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_stream.hpp +90 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_streambuf.h +21 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_tags.hpp +193 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_test_case_info.h +82 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_test_case_info.hpp +127 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_test_case_registry_impl.hpp +151 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_test_registry.hpp +120 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_test_spec.h +166 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_text.h +61 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_text.hpp +92 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_tostring.hpp +224 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_totals.hpp +67 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_version.h +37 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_version.hpp +19 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/catch_xmlwriter.hpp +211 -0
- data/ext/snowcrash/test/vendor/Catch/include/internal/clara.h +553 -0
- data/ext/snowcrash/test/vendor/Catch/include/reporters/catch_reporter_basic.hpp +353 -0
- data/ext/snowcrash/test/vendor/Catch/include/reporters/catch_reporter_console.hpp +397 -0
- data/ext/snowcrash/test/vendor/Catch/include/reporters/catch_reporter_junit.hpp +252 -0
- data/ext/snowcrash/test/vendor/Catch/include/reporters/catch_reporter_xml.hpp +145 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/ApproxTests.cpp +112 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/BDDTests.cpp +68 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/Baselines/approvedResults.txt +14686 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/ClassTests.cpp +57 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/CmdLineTests.cpp +191 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/ConditionTests.cpp +348 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/ExceptionTests.cpp +143 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/GeneratorTests.cpp +42 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/MessageTests.cpp +102 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/MiscTests.cpp +343 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_common.cpp +2 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_console_colour.cpp +2 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_debugger.cpp +2 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_capture.cpp +2 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_config.cpp +1 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_exception.cpp +1 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_generators.cpp +1 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_registry_hub.cpp +2 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_reporter.cpp +1 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_runner.cpp +1 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_interfaces_testcase.cpp +1 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_message.cpp +2 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_option.cpp +2 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_ptr.cpp +2 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_stream.cpp +2 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_streambuf.cpp +2 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_tags.cpp +2 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/SurrogateCpps/catch_xmlwriter.cpp +2 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/TestMain.cpp +561 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/TrickyTests.cpp +382 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/VariadicMacrosTests.cpp +31 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/catch_self_test.cpp +31 -0
- data/ext/snowcrash/test/vendor/Catch/projects/SelfTest/catch_self_test.hpp +177 -0
- data/ext/snowcrash/test/vendor/Catch/projects/VS2008/TestCatch/TestCatch.sln +20 -0
- data/ext/snowcrash/test/vendor/Catch/projects/VS2008/TestCatch/TestCatch/ReadMe.txt +33 -0
- data/ext/snowcrash/test/vendor/Catch/projects/VS2008/TestCatch/TestCatch/TestCatch.cpp +8 -0
- data/ext/snowcrash/test/vendor/Catch/projects/VS2008/TestCatch/TestCatch/TestCatch.vcproj +398 -0
- data/ext/snowcrash/test/vendor/Catch/projects/VS2008/TestCatch/UpgradeLog.XML +12 -0
- data/ext/snowcrash/test/vendor/Catch/projects/VS2008/TestCatch/_UpgradeReport_Files/UpgradeReport.css +207 -0
- data/ext/snowcrash/test/vendor/Catch/projects/VS2008/TestCatch/_UpgradeReport_Files/UpgradeReport.xslt +232 -0
- data/ext/snowcrash/test/vendor/Catch/projects/VS2008/TestCatch/_UpgradeReport_Files/UpgradeReport_Minus.gif +0 -0
- data/ext/snowcrash/test/vendor/Catch/projects/VS2008/TestCatch/_UpgradeReport_Files/UpgradeReport_Plus.gif +0 -0
- data/ext/snowcrash/test/vendor/Catch/projects/VS2010/TestCatch/TestCatch.sln +20 -0
- data/ext/snowcrash/test/vendor/Catch/projects/VS2010/TestCatch/TestCatch/ReadMe.txt +33 -0
- data/ext/snowcrash/test/vendor/Catch/projects/VS2010/TestCatch/TestCatch/TestCatch.cpp +8 -0
- data/ext/snowcrash/test/vendor/Catch/projects/VS2010/TestCatch/TestCatch/TestCatch.vcxproj +149 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode3/CatchSelfTest.xcodeproj/project.pbxproj +440 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode3/CatchSelfTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode3/CatchSelfTest.xcodeproj/xcuserdata/phil.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist +81 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode3/CatchSelfTest.xcodeproj/xcuserdata/phil.xcuserdatad/xcschemes/Test.xcscheme +154 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode3/CatchSelfTest.xcodeproj/xcuserdata/phil.xcuserdatad/xcschemes/xcschememanagement.plist +22 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode3/CatchSelfTestSingle/CatchSelfTestSingle.1 +79 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode3/CatchSelfTestSingle/CatchSelfTestSingle.xcodeproj/project.pbxproj +246 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode3/OCTest/CatchOCTestCase.h +25 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode3/OCTest/CatchOCTestCase.mm +45 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode3/OCTest/Main.mm +1 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode3/OCTest/OCTest.1 +79 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode3/OCTest/OCTest.mm +28 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode3/OCTest/OCTest.xcodeproj/project.pbxproj +259 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode3/OCTest/OCTest_Prefix.pch +7 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode3/OCTest/TestObj.h +25 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode3/OCTest/TestObj.m +18 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj +667 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/xcuserdata/Phil.xcuserdatad/xcschemes/xcschememanagement.plist +22 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/CatchSelfTest.1 +79 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/CatchSelfTest/CatchSelfTest/catch_text.cpp +2 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/CatchSelfTest/CatchSelfTestSingle.xcodeproj/project.pbxproj +264 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/CatchSelfTest/CatchSelfTestSingle.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/CatchSelfTest/CatchSelfTestSingle/dummy.txt +0 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/OCTest/OCTest.xcodeproj/project.pbxproj +249 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/OCTest/OCTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/OCTest/OCTest/CatchOCTestCase.h +25 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/OCTest/OCTest/CatchOCTestCase.mm +82 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/OCTest/OCTest/Main.mm +2 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/OCTest/OCTest/OCTest.1 +79 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/OCTest/OCTest/OCTest.mm +28 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/OCTest/OCTest/TestObj.h +28 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/OCTest/OCTest/TestObj.m +25 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/iOSTest/iOSTest.xcodeproj/project.pbxproj +299 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/iOSTest/iOSTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/iOSTest/iOSTest/OCTest.mm +27 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/iOSTest/iOSTest/TestObj.h +25 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/iOSTest/iOSTest/TestObj.m +18 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/iOSTest/iOSTest/en.lproj/InfoPlist.strings +2 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/iOSTest/iOSTest/iOSTest-Info.plist +47 -0
- data/ext/snowcrash/test/vendor/Catch/projects/XCode4/iOSTest/iOSTest/iOSTest-Prefix.pch +14 -0
- data/ext/snowcrash/test/vendor/Catch/projects/runners/iTchRunner/internal/iTchRunnerAppDelegate.h +114 -0
- data/ext/snowcrash/test/vendor/Catch/projects/runners/iTchRunner/internal/iTchRunnerMainView.h +189 -0
- data/ext/snowcrash/test/vendor/Catch/projects/runners/iTchRunner/internal/iTchRunnerReporter.h +115 -0
- data/ext/snowcrash/test/vendor/Catch/projects/runners/iTchRunner/itChRunnerMain.mm +27 -0
- data/ext/snowcrash/test/vendor/Catch/projects/runners/iTchRunner/readme +6 -0
- data/ext/snowcrash/test/vendor/Catch/scripts/approvalTests.py +63 -0
- data/ext/snowcrash/test/vendor/Catch/scripts/approve.py +14 -0
- data/ext/snowcrash/test/vendor/Catch/scripts/generateSingleHeader.py +117 -0
- data/ext/snowcrash/test/vendor/Catch/scripts/scriptCommon.py +4 -0
- data/ext/snowcrash/test/vendor/Catch/single_include/catch.hpp +8046 -0
- data/ext/snowcrash/tools/README.md +27 -0
- data/ext/snowcrash/tools/gyp/LICENSE +27 -0
- data/ext/snowcrash/tools/gyp/gyptest.py +274 -0
- data/ext/snowcrash/tools/gyp/pylib/gyp/MSVSSettings_test.py +1483 -0
- data/ext/snowcrash/tools/gyp/pylib/gyp/__init__.pyc +0 -0
- data/ext/snowcrash/tools/gyp/pylib/gyp/common.pyc +0 -0
- data/ext/snowcrash/tools/gyp/pylib/gyp/common_test.py +72 -0
- data/ext/snowcrash/tools/gyp/pylib/gyp/easy_xml_test.py +103 -0
- data/ext/snowcrash/tools/gyp/pylib/gyp/generator/__init__.pyc +0 -0
- data/ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyc +0 -0
- data/ext/snowcrash/tools/gyp/pylib/gyp/generator/msvs_test.py +37 -0
- data/ext/snowcrash/tools/gyp/pylib/gyp/generator/ninja_test.py +44 -0
- data/ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode.pyc +0 -0
- data/ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode_test.py +23 -0
- data/ext/snowcrash/tools/gyp/pylib/gyp/input.pyc +0 -0
- data/ext/snowcrash/tools/gyp/pylib/gyp/input_test.py +90 -0
- data/ext/snowcrash/tools/gyp/pylib/gyp/xcode_emulation.pyc +0 -0
- data/ext/snowcrash/tools/gyp/pylib/gyp/xcodeproj_file.pyc +0 -0
- data/ext/snowcrash/tools/gyp/tools/README +15 -0
- data/ext/snowcrash/tools/gyp/tools/Xcode/README +5 -0
- data/ext/snowcrash/tools/gyp/tools/emacs/README +12 -0
- data/ext/snowcrash/tools/gyp/tools/emacs/gyp-tests.el +63 -0
- data/ext/snowcrash/tools/gyp/tools/emacs/run-unit-tests.sh +7 -0
- data/ext/snowcrash/tools/gyp/tools/emacs/testdata/media.gyp +1105 -0
- data/ext/snowcrash/tools/gyp/tools/emacs/testdata/media.gyp.fontified +1107 -0
- data/lib/redsnow.rb +2 -2
- data/lib/redsnow/blueprint.rb +2 -1
- data/lib/redsnow/version.rb +1 -1
- data/pkg/redsnow-0.1.3.gem +0 -0
- data/pkg/redsnow-0.1.4.gem +0 -0
- data/pkg/redsnow-0.1.5.gem +0 -0
- data/pkg/redsnow-0.1.6.gem +0 -0
- data/pkg/redsnow-0.2.0.gem +0 -0
- data/pkg/redsnow-0.2.1.gem +0 -0
- data/pkg/redsnow-0.3.1.gem +0 -0
- data/redsnow.gemspec +2 -1
- data/test/redsnow_binding_test.rb +1 -1
- data/test/redsnow_options_test.rb +4 -4
- metadata +540 -6
- data/.gitignore +0 -34
- data/.gitmodules +0 -3
- data/.travis.yml +0 -21
@@ -0,0 +1,947 @@
|
|
1
|
+
//
|
2
|
+
// test-ResourceParser.cc
|
3
|
+
// snowcrash
|
4
|
+
//
|
5
|
+
// Created by Zdenek Nemec on 5/4/13.
|
6
|
+
// Copyright (c) 2013 Apiary Inc. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#include "snowcrashtest.h"
|
10
|
+
#include "ResourceParser.h"
|
11
|
+
#include "snowcrash.h"
|
12
|
+
|
13
|
+
using namespace snowcrash;
|
14
|
+
using namespace snowcrashtest;
|
15
|
+
|
16
|
+
mdp::ByteBuffer ResourceFixture = \
|
17
|
+
"# My Resource [/resource/{id}{?limit}]\n\n"\
|
18
|
+
"Awesome description\n\n"\
|
19
|
+
"+ Resource Model (text/plain)\n\n"\
|
20
|
+
" X.O.\n\n"\
|
21
|
+
"+ Parameters\n"\
|
22
|
+
" + id = `1234` (optional, number, `0000`)\n\n"\
|
23
|
+
" Lorem ipsum\n"\
|
24
|
+
" + Values\n"\
|
25
|
+
" + `1234`\n"\
|
26
|
+
" + `0000`\n"\
|
27
|
+
" + `beef`\n"\
|
28
|
+
" + limit\n\n"\
|
29
|
+
"## My Method [GET]\n\n"\
|
30
|
+
"Method Description\n\n"\
|
31
|
+
"+ Response 200 (text/plain)\n\n"\
|
32
|
+
" OK.";
|
33
|
+
|
34
|
+
TEST_CASE("Resource block classifier", "[resource]")
|
35
|
+
{
|
36
|
+
mdp::MarkdownParser markdownParser;
|
37
|
+
mdp::MarkdownNode markdownAST;
|
38
|
+
SectionType sectionType;
|
39
|
+
markdownParser.parse(ResourceFixture, markdownAST);
|
40
|
+
|
41
|
+
REQUIRE(!markdownAST.children().empty());
|
42
|
+
sectionType = SectionProcessor<Resource>::sectionType(markdownAST.children().begin());
|
43
|
+
REQUIRE(sectionType == ResourceSectionType);
|
44
|
+
|
45
|
+
// Nameless resource: "/resource"
|
46
|
+
markdownAST.children().front().text = "/resource";
|
47
|
+
sectionType = SectionProcessor<Resource>::sectionType(markdownAST.children().begin());
|
48
|
+
REQUIRE(sectionType == ResourceSectionType);
|
49
|
+
|
50
|
+
// Keyword "group"
|
51
|
+
markdownAST.children().front().text = "Group A";
|
52
|
+
sectionType = SectionProcessor<Resource>::sectionType(markdownAST.children().begin());
|
53
|
+
REQUIRE(sectionType == UndefinedSectionType);
|
54
|
+
|
55
|
+
// Resource Method
|
56
|
+
markdownAST.children().front().text = "GET /resource";
|
57
|
+
sectionType = SectionProcessor<Resource>::sectionType(markdownAST.children().begin());
|
58
|
+
REQUIRE(sectionType == ResourceSectionType);
|
59
|
+
}
|
60
|
+
|
61
|
+
TEST_CASE("Parse resource", "[resource]")
|
62
|
+
{
|
63
|
+
ParseResult<Resource> resource;
|
64
|
+
SectionParserHelper<Resource, ResourceParser>::parse(ResourceFixture, ResourceSectionType, resource, ExportSourcemapOption);
|
65
|
+
|
66
|
+
REQUIRE(resource.report.error.code == Error::OK);
|
67
|
+
REQUIRE(resource.report.warnings.empty());
|
68
|
+
|
69
|
+
REQUIRE(resource.node.name == "My Resource");
|
70
|
+
REQUIRE(resource.node.uriTemplate == "/resource/{id}{?limit}");
|
71
|
+
REQUIRE(resource.node.description == "Awesome description\n\n");
|
72
|
+
REQUIRE(resource.node.headers.empty());
|
73
|
+
|
74
|
+
REQUIRE(resource.node.model.name == "Resource");
|
75
|
+
REQUIRE(resource.node.model.body == "X.O.\n");
|
76
|
+
|
77
|
+
REQUIRE(resource.node.parameters.size() == 2);
|
78
|
+
REQUIRE(resource.node.parameters[0].name == "id");
|
79
|
+
REQUIRE(resource.node.parameters[0].description == "Lorem ipsum\n");
|
80
|
+
REQUIRE(resource.node.parameters[1].name == "limit");
|
81
|
+
|
82
|
+
REQUIRE(resource.node.actions.size() == 1);
|
83
|
+
REQUIRE(resource.node.actions.front().method == "GET");
|
84
|
+
|
85
|
+
REQUIRE(resource.sourceMap.name.sourceMap.size() == 1);
|
86
|
+
REQUIRE(resource.sourceMap.name.sourceMap[0].location == 0);
|
87
|
+
REQUIRE(resource.sourceMap.name.sourceMap[0].length == 40);
|
88
|
+
REQUIRE(resource.sourceMap.description.sourceMap.size() == 1);
|
89
|
+
REQUIRE(resource.sourceMap.description.sourceMap[0].location == 40);
|
90
|
+
REQUIRE(resource.sourceMap.description.sourceMap[0].length == 21);
|
91
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap.size() == 1);
|
92
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].location == 0);
|
93
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].length == 40);
|
94
|
+
REQUIRE(resource.sourceMap.headers.collection.size() == 0);
|
95
|
+
REQUIRE(resource.sourceMap.parameters.collection.size() == 2);
|
96
|
+
REQUIRE(resource.sourceMap.parameters.collection[0].name.sourceMap.size() == 1);
|
97
|
+
REQUIRE(resource.sourceMap.parameters.collection[0].name.sourceMap[0].location == 125);
|
98
|
+
REQUIRE(resource.sourceMap.parameters.collection[0].name.sourceMap[0].length == 40);
|
99
|
+
REQUIRE(resource.sourceMap.parameters.collection[1].name.sourceMap.size() == 1);
|
100
|
+
REQUIRE(resource.sourceMap.parameters.collection[1].name.sourceMap[0].location == 271);
|
101
|
+
REQUIRE(resource.sourceMap.parameters.collection[1].name.sourceMap[0].length == 6);
|
102
|
+
REQUIRE(resource.sourceMap.model.name.sourceMap.size() == 1);
|
103
|
+
REQUIRE(resource.sourceMap.model.name.sourceMap[0].location == 63);
|
104
|
+
REQUIRE(resource.sourceMap.model.name.sourceMap[0].length == 29);
|
105
|
+
REQUIRE(resource.sourceMap.model.body.sourceMap.size() == 1);
|
106
|
+
REQUIRE(resource.sourceMap.model.body.sourceMap[0].location == 96);
|
107
|
+
REQUIRE(resource.sourceMap.model.body.sourceMap[0].length == 9);
|
108
|
+
REQUIRE(resource.sourceMap.actions.collection.size() == 1);
|
109
|
+
REQUIRE(resource.sourceMap.actions.collection[0].method.sourceMap.size() == 1);
|
110
|
+
REQUIRE(resource.sourceMap.actions.collection[0].method.sourceMap[0].location == 278);
|
111
|
+
REQUIRE(resource.sourceMap.actions.collection[0].method.sourceMap[0].length == 20);
|
112
|
+
}
|
113
|
+
|
114
|
+
TEST_CASE("Parse partially defined resource", "[resource]")
|
115
|
+
{
|
116
|
+
mdp::ByteBuffer source = \
|
117
|
+
"# /1\n"\
|
118
|
+
"## GET\n"\
|
119
|
+
"+ Request\n"\
|
120
|
+
"p1\n";
|
121
|
+
|
122
|
+
ParseResult<Resource> resource;
|
123
|
+
SectionParserHelper<Resource, ResourceParser>::parse(source, ResourceSectionType, resource, ExportSourcemapOption);
|
124
|
+
|
125
|
+
REQUIRE(resource.report.error.code == Error::OK);
|
126
|
+
REQUIRE(resource.report.warnings.size() == 2); // no response & preformatted asset
|
127
|
+
REQUIRE(resource.report.warnings[0].code == IndentationWarning);
|
128
|
+
REQUIRE(resource.report.warnings[1].code == EmptyDefinitionWarning);
|
129
|
+
|
130
|
+
REQUIRE(resource.node.name.empty());
|
131
|
+
REQUIRE(resource.node.uriTemplate == "/1");
|
132
|
+
REQUIRE(resource.node.description.empty());
|
133
|
+
REQUIRE(resource.node.model.name.empty());
|
134
|
+
REQUIRE(resource.node.model.body.empty());
|
135
|
+
REQUIRE(resource.node.actions.size() == 1);
|
136
|
+
REQUIRE(resource.node.actions.front().method == "GET");
|
137
|
+
REQUIRE(resource.node.actions.front().description.empty());
|
138
|
+
REQUIRE(!resource.node.actions.front().examples.empty());
|
139
|
+
REQUIRE(resource.node.actions.front().examples.front().requests.size() == 1);
|
140
|
+
REQUIRE(resource.node.actions.front().examples.front().requests.front().name.empty());
|
141
|
+
REQUIRE(resource.node.actions.front().examples.front().requests.front().description.empty());
|
142
|
+
REQUIRE(resource.node.actions.front().examples.front().requests.front().body == "p1\n\n");
|
143
|
+
|
144
|
+
REQUIRE(resource.sourceMap.name.sourceMap.empty());
|
145
|
+
REQUIRE(resource.sourceMap.description.sourceMap.empty());
|
146
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap.size() == 1);
|
147
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].location == 0);
|
148
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].length == 5);
|
149
|
+
REQUIRE(resource.sourceMap.actions.collection.size() == 1);
|
150
|
+
REQUIRE(resource.sourceMap.actions.collection[0].method.sourceMap.size() == 1);
|
151
|
+
REQUIRE(resource.sourceMap.actions.collection[0].method.sourceMap[0].location == 5);
|
152
|
+
REQUIRE(resource.sourceMap.actions.collection[0].method.sourceMap[0].length == 7);
|
153
|
+
}
|
154
|
+
|
155
|
+
TEST_CASE("Parse multiple method descriptions", "[resource]")
|
156
|
+
{
|
157
|
+
mdp::ByteBuffer source = \
|
158
|
+
"# /1\n"\
|
159
|
+
"# GET\n"\
|
160
|
+
"p1\n"\
|
161
|
+
"# POST\n"\
|
162
|
+
"p2\n";
|
163
|
+
|
164
|
+
ParseResult<Resource> resource;
|
165
|
+
SectionParserHelper<Resource, ResourceParser>::parse(source, ResourceSectionType, resource, ExportSourcemapOption);
|
166
|
+
|
167
|
+
REQUIRE(resource.report.error.code == Error::OK);
|
168
|
+
REQUIRE(resource.report.warnings.size() == 2); // 2x no response
|
169
|
+
|
170
|
+
REQUIRE(resource.node.uriTemplate == "/1");
|
171
|
+
REQUIRE(resource.node.description.empty());
|
172
|
+
REQUIRE(resource.node.model.name.empty());
|
173
|
+
REQUIRE(resource.node.model.body.empty());
|
174
|
+
REQUIRE(resource.node.actions.size() == 2);
|
175
|
+
REQUIRE(resource.node.actions[0].method == "GET");
|
176
|
+
REQUIRE(resource.node.actions[0].description == "p1\n");
|
177
|
+
REQUIRE(resource.node.actions[1].method == "POST");
|
178
|
+
REQUIRE(resource.node.actions[1].description == "p2\n");
|
179
|
+
|
180
|
+
REQUIRE(resource.sourceMap.name.sourceMap.empty());
|
181
|
+
REQUIRE(resource.sourceMap.description.sourceMap.empty());
|
182
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap.size() == 1);
|
183
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].location == 0);
|
184
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].length == 5);
|
185
|
+
REQUIRE(resource.sourceMap.actions.collection.size() == 2);
|
186
|
+
REQUIRE(resource.sourceMap.actions.collection[0].method.sourceMap.size() == 1);
|
187
|
+
REQUIRE(resource.sourceMap.actions.collection[0].method.sourceMap[0].location == 5);
|
188
|
+
REQUIRE(resource.sourceMap.actions.collection[0].method.sourceMap[0].length == 6);
|
189
|
+
REQUIRE(resource.sourceMap.actions.collection[1].method.sourceMap.size() == 1);
|
190
|
+
REQUIRE(resource.sourceMap.actions.collection[1].method.sourceMap[0].location == 14);
|
191
|
+
REQUIRE(resource.sourceMap.actions.collection[1].method.sourceMap[0].length == 7);
|
192
|
+
}
|
193
|
+
|
194
|
+
TEST_CASE("Parse multiple methods", "[resource]")
|
195
|
+
{
|
196
|
+
mdp::ByteBuffer source = \
|
197
|
+
"# /1\n"\
|
198
|
+
"A\n"\
|
199
|
+
"## GET\n"\
|
200
|
+
"B\n"\
|
201
|
+
"+ Response 200\n"\
|
202
|
+
" + Body\n\n"\
|
203
|
+
" Code 1\n\n"\
|
204
|
+
"## POST\n"\
|
205
|
+
"C\n"\
|
206
|
+
"+ Request D\n"\
|
207
|
+
"+ Response 200\n"\
|
208
|
+
" + Body\n\n"
|
209
|
+
" {}\n\n"\
|
210
|
+
"## PUT\n"\
|
211
|
+
"E\n";
|
212
|
+
|
213
|
+
ParseResult<Resource> resource;
|
214
|
+
SectionParserHelper<Resource, ResourceParser>::parse(source, ResourceSectionType, resource, ExportSourcemapOption);
|
215
|
+
|
216
|
+
REQUIRE(resource.report.error.code == Error::OK);
|
217
|
+
REQUIRE(resource.report.warnings.size() == 2); // empty reuqest asset & no response
|
218
|
+
|
219
|
+
REQUIRE(resource.node.uriTemplate == "/1");
|
220
|
+
REQUIRE(resource.node.description == "A\n");
|
221
|
+
REQUIRE(resource.node.model.name.empty());
|
222
|
+
REQUIRE(resource.node.model.body.empty());
|
223
|
+
REQUIRE(resource.node.actions.size() == 3);
|
224
|
+
|
225
|
+
REQUIRE(resource.node.actions[0].method == "GET");
|
226
|
+
REQUIRE(resource.node.actions[0].description == "B\n");
|
227
|
+
REQUIRE(resource.node.actions[0].examples.size() == 1);
|
228
|
+
REQUIRE(resource.node.actions[0].examples[0].requests.empty());
|
229
|
+
REQUIRE(resource.node.actions[0].examples[0].responses.size() == 1);
|
230
|
+
REQUIRE(resource.node.actions[0].examples[0].responses[0].name == "200");
|
231
|
+
REQUIRE(resource.node.actions[0].examples[0].responses[0].description.empty());
|
232
|
+
REQUIRE(resource.node.actions[0].examples[0].responses[0].body == "Code 1\n");
|
233
|
+
|
234
|
+
REQUIRE(resource.node.actions[1].method == "POST");
|
235
|
+
REQUIRE(resource.node.actions[1].description == "C\n");
|
236
|
+
REQUIRE(resource.node.actions[1].examples.size() == 1);
|
237
|
+
REQUIRE(resource.node.actions[1].examples[0].requests.size() == 1);
|
238
|
+
REQUIRE(resource.node.actions[1].examples[0].requests[0].name == "D");
|
239
|
+
REQUIRE(resource.node.actions[1].examples[0].requests[0].description.empty());
|
240
|
+
REQUIRE(resource.node.actions[1].examples[0].requests[0].description.empty());
|
241
|
+
REQUIRE(resource.node.actions[1].examples[0].responses.size() == 1);
|
242
|
+
REQUIRE(resource.node.actions[1].examples[0].responses[0].name == "200");
|
243
|
+
REQUIRE(resource.node.actions[1].examples[0].responses[0].description.empty());
|
244
|
+
REQUIRE(resource.node.actions[1].examples[0].responses[0].body == "{}\n");
|
245
|
+
|
246
|
+
REQUIRE(resource.node.actions[2].method == "PUT");
|
247
|
+
REQUIRE(resource.node.actions[2].description == "E\n");
|
248
|
+
REQUIRE(resource.node.actions[2].examples.empty());
|
249
|
+
|
250
|
+
REQUIRE(resource.sourceMap.name.sourceMap.empty());
|
251
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap.size() == 1);
|
252
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].location == 0);
|
253
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].length == 5);
|
254
|
+
REQUIRE(resource.sourceMap.actions.collection.size() == 3);
|
255
|
+
REQUIRE(resource.sourceMap.actions.collection[0].method.sourceMap.size() == 1);
|
256
|
+
REQUIRE(resource.sourceMap.actions.collection[0].method.sourceMap[0].location == 7);
|
257
|
+
REQUIRE(resource.sourceMap.actions.collection[0].method.sourceMap[0].length == 7);
|
258
|
+
REQUIRE(resource.sourceMap.actions.collection[1].method.sourceMap.size() == 1);
|
259
|
+
REQUIRE(resource.sourceMap.actions.collection[1].method.sourceMap[0].location == 63);
|
260
|
+
REQUIRE(resource.sourceMap.actions.collection[1].method.sourceMap[0].length == 8);
|
261
|
+
REQUIRE(resource.sourceMap.actions.collection[2].method.sourceMap.size() == 1);
|
262
|
+
REQUIRE(resource.sourceMap.actions.collection[2].method.sourceMap[0].location == 128);
|
263
|
+
REQUIRE(resource.sourceMap.actions.collection[2].method.sourceMap[0].length == 7);
|
264
|
+
}
|
265
|
+
|
266
|
+
TEST_CASE("Parse description with list", "[resource]")
|
267
|
+
{
|
268
|
+
mdp::ByteBuffer source = \
|
269
|
+
"# /1\n"\
|
270
|
+
"+ A\n"\
|
271
|
+
"+ B\n\n"\
|
272
|
+
"p1\n";
|
273
|
+
|
274
|
+
ParseResult<Resource> resource;
|
275
|
+
SectionParserHelper<Resource, ResourceParser>::parse(source, ResourceSectionType, resource, ExportSourcemapOption);
|
276
|
+
|
277
|
+
REQUIRE(resource.report.error.code == Error::OK);
|
278
|
+
REQUIRE(resource.report.warnings.empty());
|
279
|
+
|
280
|
+
REQUIRE(resource.node.uriTemplate == "/1");
|
281
|
+
REQUIRE(resource.node.description == "+ A\n\n+ B\n\np1\n");
|
282
|
+
REQUIRE(resource.node.model.name.empty());
|
283
|
+
REQUIRE(resource.node.model.body.empty());
|
284
|
+
REQUIRE(resource.node.actions.empty());
|
285
|
+
|
286
|
+
REQUIRE(resource.sourceMap.name.sourceMap.empty());
|
287
|
+
REQUIRE(resource.sourceMap.description.sourceMap.size() == 1);
|
288
|
+
REQUIRE(resource.sourceMap.description.sourceMap[0].location == 5);
|
289
|
+
REQUIRE(resource.sourceMap.description.sourceMap[0].length == 12);
|
290
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap.size() == 1);
|
291
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].location == 0);
|
292
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].length == 5);
|
293
|
+
REQUIRE(resource.sourceMap.actions.collection.empty());
|
294
|
+
}
|
295
|
+
|
296
|
+
TEST_CASE("Parse resource with a HR", "[resource][block]")
|
297
|
+
{
|
298
|
+
mdp::ByteBuffer source = \
|
299
|
+
"# /1\n"\
|
300
|
+
"A\n"\
|
301
|
+
"---\n"\
|
302
|
+
"B\n";
|
303
|
+
|
304
|
+
ParseResult<Resource> resource;
|
305
|
+
SectionParserHelper<Resource, ResourceParser>::parse(source, ResourceSectionType, resource, ExportSourcemapOption);
|
306
|
+
|
307
|
+
REQUIRE(resource.report.error.code == Error::OK);
|
308
|
+
REQUIRE(resource.report.warnings.empty());
|
309
|
+
|
310
|
+
REQUIRE(resource.node.uriTemplate == "/1");
|
311
|
+
REQUIRE(resource.node.description == "A\n---\n\nB\n");
|
312
|
+
REQUIRE(resource.node.model.name.empty());
|
313
|
+
REQUIRE(resource.node.model.body.empty());
|
314
|
+
REQUIRE(resource.node.actions.empty());
|
315
|
+
|
316
|
+
REQUIRE(resource.sourceMap.name.sourceMap.empty());
|
317
|
+
REQUIRE(resource.sourceMap.description.sourceMap.size() == 1);
|
318
|
+
REQUIRE(resource.sourceMap.description.sourceMap[0].location == 5);
|
319
|
+
REQUIRE(resource.sourceMap.description.sourceMap[0].length == 8);
|
320
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap.size() == 1);
|
321
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].location == 0);
|
322
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].length == 5);
|
323
|
+
REQUIRE(resource.sourceMap.actions.collection.empty());
|
324
|
+
}
|
325
|
+
|
326
|
+
TEST_CASE("Parse resource method abbreviation", "[resource]")
|
327
|
+
{
|
328
|
+
mdp::ByteBuffer source = \
|
329
|
+
"# GET /resource\n"\
|
330
|
+
"Description\n"\
|
331
|
+
"+ Response 200\n"\
|
332
|
+
" + Body\n\n"\
|
333
|
+
" {}\n";
|
334
|
+
|
335
|
+
ParseResult<Resource> resource;
|
336
|
+
SectionParserHelper<Resource, ResourceParser>::parse(source, ResourceSectionType, resource, ExportSourcemapOption);
|
337
|
+
|
338
|
+
REQUIRE(resource.report.error.code == Error::OK);
|
339
|
+
REQUIRE(resource.report.warnings.empty());
|
340
|
+
|
341
|
+
REQUIRE(resource.node.name.empty());
|
342
|
+
REQUIRE(resource.node.uriTemplate == "/resource");
|
343
|
+
REQUIRE(resource.node.actions.size() == 1);
|
344
|
+
REQUIRE(resource.node.actions[0].method == "GET");
|
345
|
+
REQUIRE(resource.node.actions[0].description == "Description\n");
|
346
|
+
|
347
|
+
REQUIRE(resource.node.actions[0].examples[0].responses.size() == 1);
|
348
|
+
REQUIRE(resource.node.actions[0].examples[0].responses[0].description.empty());
|
349
|
+
REQUIRE(resource.node.actions[0].examples[0].responses[0].body == "{}\n");
|
350
|
+
|
351
|
+
REQUIRE(resource.sourceMap.name.sourceMap.empty());
|
352
|
+
REQUIRE(resource.sourceMap.description.sourceMap.empty());
|
353
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap.size() == 1);
|
354
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].location == 0);
|
355
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].length == 16);
|
356
|
+
REQUIRE(resource.sourceMap.actions.collection.size() == 1);
|
357
|
+
REQUIRE(resource.sourceMap.actions.collection[0].method.sourceMap.size() == 1);
|
358
|
+
REQUIRE(resource.sourceMap.actions.collection[0].method.sourceMap[0].location == 0);
|
359
|
+
REQUIRE(resource.sourceMap.actions.collection[0].method.sourceMap[0].length == 16);
|
360
|
+
}
|
361
|
+
|
362
|
+
TEST_CASE("Parse resource without name", "[resource]")
|
363
|
+
{
|
364
|
+
mdp::ByteBuffer source = "# /resource\n";
|
365
|
+
|
366
|
+
ParseResult<Resource> resource;
|
367
|
+
SectionParserHelper<Resource, ResourceParser>::parse(source, ResourceSectionType, resource, ExportSourcemapOption);
|
368
|
+
|
369
|
+
REQUIRE(resource.report.error.code == Error::OK);
|
370
|
+
REQUIRE(resource.report.warnings.empty());
|
371
|
+
|
372
|
+
REQUIRE(resource.node.uriTemplate == "/resource");
|
373
|
+
REQUIRE(resource.node.name.empty());
|
374
|
+
REQUIRE(resource.node.model.name.empty());
|
375
|
+
REQUIRE(resource.node.model.body.empty());
|
376
|
+
REQUIRE(resource.node.actions.size() == 0);
|
377
|
+
|
378
|
+
REQUIRE(resource.sourceMap.name.sourceMap.empty());
|
379
|
+
REQUIRE(resource.sourceMap.description.sourceMap.empty());
|
380
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap.size() == 1);
|
381
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].location == 0);
|
382
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].length == 12);
|
383
|
+
REQUIRE(resource.sourceMap.actions.collection.empty());
|
384
|
+
}
|
385
|
+
|
386
|
+
TEST_CASE("Warn about parameters not in URI template", "[resource][source]")
|
387
|
+
{
|
388
|
+
mdp::ByteBuffer source = \
|
389
|
+
"# /resource/{id}\n"\
|
390
|
+
"+ Parameters\n"\
|
391
|
+
" + olive\n\n"\
|
392
|
+
"## GET\n"\
|
393
|
+
"+ Parameters\n"\
|
394
|
+
" + cheese\n"\
|
395
|
+
" + id\n\n"\
|
396
|
+
"+ Response 204\n\n";
|
397
|
+
|
398
|
+
ParseResult<Resource> resource;
|
399
|
+
SectionParserHelper<Resource, ResourceParser>::parse(source, ResourceSectionType, resource, ExportSourcemapOption);
|
400
|
+
|
401
|
+
REQUIRE(resource.report.error.code == Error::OK);
|
402
|
+
REQUIRE(resource.report.warnings.size() == 2);
|
403
|
+
REQUIRE(resource.report.warnings[0].code == LogicalErrorWarning);
|
404
|
+
REQUIRE(resource.report.warnings[1].code == LogicalErrorWarning);
|
405
|
+
|
406
|
+
REQUIRE(resource.node.parameters.size() == 1);
|
407
|
+
REQUIRE(resource.node.parameters[0].name == "olive");
|
408
|
+
REQUIRE(resource.node.actions.size() == 1);
|
409
|
+
REQUIRE(resource.node.actions[0].examples.size() == 1);
|
410
|
+
REQUIRE(resource.node.actions[0].examples[0].responses.size() == 1);
|
411
|
+
|
412
|
+
REQUIRE(resource.sourceMap.name.sourceMap.empty());
|
413
|
+
REQUIRE(resource.sourceMap.description.sourceMap.empty());
|
414
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap.size() == 1);
|
415
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].location == 0);
|
416
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].length == 17);
|
417
|
+
REQUIRE(resource.sourceMap.parameters.collection.size() == 1);
|
418
|
+
REQUIRE(resource.sourceMap.actions.collection.size() == 1);
|
419
|
+
}
|
420
|
+
|
421
|
+
TEST_CASE("Parse nameless resource with named model", "[resource][model][source]")
|
422
|
+
{
|
423
|
+
mdp::ByteBuffer source = \
|
424
|
+
"# /message\n"\
|
425
|
+
"+ Super Model\n"\
|
426
|
+
"\n"\
|
427
|
+
" AAA\n"\
|
428
|
+
"\n";
|
429
|
+
|
430
|
+
ParseResult<Resource> resource;
|
431
|
+
SectionParserHelper<Resource, ResourceParser>::parse(source, ResourceSectionType, resource, ExportSourcemapOption);
|
432
|
+
|
433
|
+
REQUIRE(resource.report.error.code == Error::OK);
|
434
|
+
REQUIRE(resource.report.warnings.empty());
|
435
|
+
|
436
|
+
REQUIRE(resource.node.model.name == "Super");
|
437
|
+
REQUIRE(resource.node.model.body == "AAA\n");
|
438
|
+
REQUIRE(resource.node.actions.empty());
|
439
|
+
|
440
|
+
REQUIRE(resource.sourceMap.name.sourceMap.empty());
|
441
|
+
REQUIRE(resource.sourceMap.description.sourceMap.empty());
|
442
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap.size() == 1);
|
443
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].location == 0);
|
444
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].length == 11);
|
445
|
+
REQUIRE(resource.sourceMap.model.name.sourceMap.size() == 1);
|
446
|
+
REQUIRE(resource.sourceMap.model.name.sourceMap[0].location == 13);
|
447
|
+
REQUIRE(resource.sourceMap.model.name.sourceMap[0].length == 13);
|
448
|
+
REQUIRE(resource.sourceMap.parameters.collection.empty());
|
449
|
+
REQUIRE(resource.sourceMap.actions.collection.empty());
|
450
|
+
}
|
451
|
+
|
452
|
+
TEST_CASE("Parse nameless resource with nameless model", "[resource][model][source]")
|
453
|
+
{
|
454
|
+
mdp::ByteBuffer source = \
|
455
|
+
"# /message\n"\
|
456
|
+
"+ Model\n"\
|
457
|
+
"\n"\
|
458
|
+
" AAA\n"\
|
459
|
+
"\n";
|
460
|
+
|
461
|
+
ParseResult<Resource> resource;
|
462
|
+
SectionParserHelper<Resource, ResourceParser>::parse(source, ResourceSectionType, resource, ExportSourcemapOption);
|
463
|
+
|
464
|
+
REQUIRE(resource.report.error.code == SymbolError);
|
465
|
+
REQUIRE(resource.report.warnings.empty());
|
466
|
+
|
467
|
+
REQUIRE(resource.node.model.name.empty());
|
468
|
+
|
469
|
+
REQUIRE(resource.sourceMap.name.sourceMap.empty());
|
470
|
+
REQUIRE(resource.sourceMap.description.sourceMap.empty());
|
471
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap.size() == 1);
|
472
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].location == 0);
|
473
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].length == 11);
|
474
|
+
REQUIRE(resource.sourceMap.model.name.sourceMap.empty());
|
475
|
+
REQUIRE(resource.sourceMap.parameters.collection.empty());
|
476
|
+
REQUIRE(resource.sourceMap.actions.collection.empty());
|
477
|
+
}
|
478
|
+
|
479
|
+
TEST_CASE("Parse named resource with nameless model", "[resource][model][source]")
|
480
|
+
{
|
481
|
+
mdp::ByteBuffer source = \
|
482
|
+
"# Message [/message]\n"\
|
483
|
+
"+ Model\n\n"\
|
484
|
+
" AAA\n"\
|
485
|
+
"\n"\
|
486
|
+
"## Retrieve a message [GET]\n"\
|
487
|
+
"+ Response 200\n\n"\
|
488
|
+
" [Message][]\n\n";
|
489
|
+
|
490
|
+
ParseResult<Resource> resource;
|
491
|
+
SectionParserHelper<Resource, ResourceParser>::parse(source, ResourceSectionType, resource, ExportSourcemapOption);
|
492
|
+
|
493
|
+
REQUIRE(resource.report.error.code == Error::OK);
|
494
|
+
REQUIRE(resource.report.warnings.empty());
|
495
|
+
|
496
|
+
REQUIRE(resource.node.model.name == "Message");
|
497
|
+
REQUIRE(resource.node.model.body == "AAA\n");
|
498
|
+
REQUIRE(resource.node.actions.size() == 1);
|
499
|
+
REQUIRE(resource.node.actions[0].name == "Retrieve a message");
|
500
|
+
REQUIRE(resource.node.actions[0].method == "GET");
|
501
|
+
REQUIRE(resource.node.actions[0].examples.size() == 1);
|
502
|
+
REQUIRE(resource.node.actions[0].examples[0].responses.size() == 1);
|
503
|
+
REQUIRE(resource.node.actions[0].examples[0].responses[0].name == "200");
|
504
|
+
REQUIRE(resource.node.actions[0].examples[0].responses[0].body == "AAA\n");
|
505
|
+
|
506
|
+
REQUIRE(resource.sourceMap.name.sourceMap.size() == 1);
|
507
|
+
REQUIRE(resource.sourceMap.name.sourceMap[0].location == 0);
|
508
|
+
REQUIRE(resource.sourceMap.name.sourceMap[0].length == 21);
|
509
|
+
REQUIRE(resource.sourceMap.description.sourceMap.empty());
|
510
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap.size() == 1);
|
511
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].location == 0);
|
512
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].length == 21);
|
513
|
+
REQUIRE(resource.sourceMap.parameters.collection.empty());
|
514
|
+
REQUIRE(resource.sourceMap.actions.collection.size() == 1);
|
515
|
+
REQUIRE(resource.sourceMap.model.name.sourceMap.size() == 1);
|
516
|
+
REQUIRE(resource.sourceMap.model.name.sourceMap[0].location == 0);
|
517
|
+
REQUIRE(resource.sourceMap.model.name.sourceMap[0].length == 21);
|
518
|
+
}
|
519
|
+
|
520
|
+
TEST_CASE("Parse model with unrecognised resource", "[resource][model]")
|
521
|
+
{
|
522
|
+
mdp::ByteBuffer source = \
|
523
|
+
"# Resource [/1]\n\n"\
|
524
|
+
"+ Model (plain/text)\n\n"\
|
525
|
+
" AAA\n\n"\
|
526
|
+
"## Retrieve a resource [GET]\n\n"\
|
527
|
+
"+ Response 200\n\n"\
|
528
|
+
" + Headers\n\n"\
|
529
|
+
" X-Header: A\n\n"\
|
530
|
+
" + Body\n\n"\
|
531
|
+
" [Resource][]";
|
532
|
+
|
533
|
+
ParseResult<Resource> resource;
|
534
|
+
SectionParserHelper<Resource, ResourceParser>::parse(source, ResourceSectionType, resource);
|
535
|
+
|
536
|
+
REQUIRE(resource.report.error.code == Error::OK);
|
537
|
+
REQUIRE(resource.report.warnings.size() == 1);
|
538
|
+
REQUIRE(resource.report.warnings[0].code == IgnoringWarning);
|
539
|
+
|
540
|
+
REQUIRE(resource.node.model.name == "Resource");
|
541
|
+
REQUIRE(resource.node.model.body == "AAA\n");
|
542
|
+
REQUIRE(resource.node.actions.size() == 1);
|
543
|
+
REQUIRE(resource.node.actions[0].name == "Retrieve a resource");
|
544
|
+
REQUIRE(resource.node.actions[0].method == "GET");
|
545
|
+
REQUIRE(resource.node.actions[0].examples.size() == 1);
|
546
|
+
REQUIRE(resource.node.actions[0].examples[0].responses.size() == 1);
|
547
|
+
REQUIRE(resource.node.actions[0].examples[0].responses[0].name == "200");
|
548
|
+
REQUIRE(resource.node.actions[0].examples[0].responses[0].body == "[Resource][]\n");
|
549
|
+
REQUIRE(resource.node.actions[0].examples[0].responses[0].description == "");
|
550
|
+
}
|
551
|
+
|
552
|
+
TEST_CASE("Parse named resource with lazy referencing", "[resource][model][issue][#84]")
|
553
|
+
{
|
554
|
+
mdp::ByteBuffer source = \
|
555
|
+
"#api name\n\n"\
|
556
|
+
"# Resource 1 [/1]\n"\
|
557
|
+
"## Retrieve [GET]\n\n"\
|
558
|
+
"+ Response 200\n\n"\
|
559
|
+
" [Resource 2][]\n\n"\
|
560
|
+
"# Resource 2 [/2]\n"\
|
561
|
+
"+ Model (text/plain)\n\n"\
|
562
|
+
" `resource model` 2\n";
|
563
|
+
|
564
|
+
ParseResult<Blueprint> blueprint;
|
565
|
+
parse(source, ExportSourcemapOption, blueprint);
|
566
|
+
|
567
|
+
REQUIRE(blueprint.report.error.code == Error::OK);
|
568
|
+
REQUIRE(blueprint.report.warnings.empty());
|
569
|
+
|
570
|
+
REQUIRE(blueprint.node.name == "api name");
|
571
|
+
REQUIRE(blueprint.node.description == "");
|
572
|
+
|
573
|
+
REQUIRE(blueprint.node.resourceGroups.size() == 1);
|
574
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources.size() == 2);
|
575
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].uriTemplate == "/1");
|
576
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].name == "Resource 1");
|
577
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].name == "Resource 1");
|
578
|
+
|
579
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions.size() == 1);
|
580
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].method == "GET");
|
581
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].name == "Retrieve");
|
582
|
+
|
583
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples.size() == 1);
|
584
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].responses.size() == 1);
|
585
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].responses[0].name == "200");
|
586
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].responses[0].body == "`resource model` 2\n");
|
587
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].responses[0].headers.size() == 1);
|
588
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].responses[0].headers[0].first == "Content-Type");
|
589
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].responses[0].headers[0].second == "text/plain");
|
590
|
+
|
591
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].responses[0].reference.id == "Resource 2");
|
592
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].responses[0].reference.type == Reference::SymbolReference);
|
593
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].responses[0].reference.meta.state == Reference::StateResolved);
|
594
|
+
|
595
|
+
SourceMap<Resources> resourcesSourceMap = blueprint.sourceMap.resourceGroups.collection[0].resources;
|
596
|
+
SourceMap<TransactionExamples> examplesSourceMap = resourcesSourceMap.collection[0].actions.collection[0].examples;
|
597
|
+
|
598
|
+
REQUIRE(examplesSourceMap.collection[0].responses.collection[0].headers.collection[0].sourceMap.size() == 1);
|
599
|
+
REQUIRE(examplesSourceMap.collection[0].responses.collection[0].headers.collection[0].sourceMap[0].length == 20);
|
600
|
+
REQUIRE(examplesSourceMap.collection[0].responses.collection[0].headers.collection[0].sourceMap[0].location == 104);
|
601
|
+
|
602
|
+
REQUIRE(examplesSourceMap.collection[0].responses.collection[0].reference.sourceMap.size() == 1);
|
603
|
+
REQUIRE(examplesSourceMap.collection[0].responses.collection[0].reference.sourceMap[0].length == 15);
|
604
|
+
REQUIRE(examplesSourceMap.collection[0].responses.collection[0].reference.sourceMap[0].location == 68);
|
605
|
+
}
|
606
|
+
|
607
|
+
TEST_CASE("Parse named resource with lazy referencing with both response and request", "[resource][model]")
|
608
|
+
{
|
609
|
+
mdp::ByteBuffer source = \
|
610
|
+
"# API\n"\
|
611
|
+
"\n"\
|
612
|
+
"# Collection of Items [/items]\n"\
|
613
|
+
"+ Model (application/json)\n"\
|
614
|
+
"\n"\
|
615
|
+
" [ { item 1 }, { item 2 } ]\n"\
|
616
|
+
"\n"\
|
617
|
+
"## Create New Item [POST]\n"\
|
618
|
+
"+ Request\n"\
|
619
|
+
"\n"\
|
620
|
+
" [Item][]\n"\
|
621
|
+
"\n"\
|
622
|
+
"+ Response 200\n"\
|
623
|
+
"\n"\
|
624
|
+
" [Collection of Items][]\n"\
|
625
|
+
"\n"\
|
626
|
+
"# Item [/items/{id}]\n"\
|
627
|
+
"+ Model (application/json)\n"\
|
628
|
+
"\n"\
|
629
|
+
" { item }\n";
|
630
|
+
|
631
|
+
ParseResult<Blueprint> blueprint;
|
632
|
+
parse(source, 0, blueprint);
|
633
|
+
|
634
|
+
REQUIRE(blueprint.report.error.code == Error::OK);
|
635
|
+
REQUIRE(blueprint.report.warnings.empty());
|
636
|
+
|
637
|
+
REQUIRE(blueprint.node.name == "API");
|
638
|
+
REQUIRE(blueprint.node.description == "");
|
639
|
+
|
640
|
+
REQUIRE(blueprint.node.resourceGroups.size() == 1);
|
641
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources.size() == 2);
|
642
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].uriTemplate == "/items");
|
643
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].name == "Collection of Items");
|
644
|
+
|
645
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions.size() == 1);
|
646
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].method == "POST");
|
647
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].name == "Create New Item");
|
648
|
+
|
649
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples.size() == 1);
|
650
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].requests.size() == 1);
|
651
|
+
|
652
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].requests[0].name == "");
|
653
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].requests[0].body == "{ item }\n");
|
654
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].requests[0].headers.size() == 1);
|
655
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].requests[0].headers[0].first == "Content-Type");
|
656
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].requests[0].headers[0].second == "application/json");
|
657
|
+
|
658
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].requests[0].reference.id == "Item");
|
659
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].requests[0].reference.type == Reference::SymbolReference);
|
660
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].requests[0].reference.meta.state == Reference::StateResolved);
|
661
|
+
|
662
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].responses.size() == 1);
|
663
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].responses[0].name == "200");
|
664
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].responses[0].body == "[ { item 1 }, { item 2 } ]\n");
|
665
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].responses[0].headers.size() == 1);
|
666
|
+
|
667
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].responses[0].reference.id == "Collection of Items");
|
668
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].responses[0].reference.type == Reference::SymbolReference);
|
669
|
+
REQUIRE(blueprint.node.resourceGroups[0].resources[0].actions[0].examples[0].responses[0].reference.meta.state == Reference::StateResolved);
|
670
|
+
}
|
671
|
+
|
672
|
+
TEST_CASE("Expect to have a warning when 100 responce's reference has a body", "[resource][model]")
|
673
|
+
{
|
674
|
+
mdp::ByteBuffer source = \
|
675
|
+
"# API\n"\
|
676
|
+
"\n"\
|
677
|
+
"# Collection of Items [/items]\n"\
|
678
|
+
"+ Model (application/json)\n"\
|
679
|
+
"\n"\
|
680
|
+
" [ { item 1 }, { item 2 } ]\n"\
|
681
|
+
"\n"\
|
682
|
+
"## Create New Item [POST]\n"\
|
683
|
+
"+ Request\n"\
|
684
|
+
"\n"\
|
685
|
+
" [Collection of Items][]\n"\
|
686
|
+
"\n"\
|
687
|
+
"+ Response 100\n"\
|
688
|
+
"\n"\
|
689
|
+
" [Item][]\n"\
|
690
|
+
"\n"\
|
691
|
+
"# Item [/items/{id}]\n"\
|
692
|
+
"+ Model (application/json)\n"\
|
693
|
+
"\n"\
|
694
|
+
" { item }\n";
|
695
|
+
|
696
|
+
ParseResult<Blueprint> blueprint;
|
697
|
+
parse(source, 0, blueprint);
|
698
|
+
|
699
|
+
REQUIRE(blueprint.report.error.code == Error::OK);
|
700
|
+
REQUIRE(blueprint.report.warnings.size() == 1);
|
701
|
+
|
702
|
+
REQUIRE(blueprint.report.warnings[0].code == EmptyDefinitionWarning);
|
703
|
+
}
|
704
|
+
|
705
|
+
TEST_CASE("Parse named resource with nameless model but reference a non-existing model", "[resource]")
|
706
|
+
{
|
707
|
+
mdp::ByteBuffer source = \
|
708
|
+
"# Posts [/posts]\n"\
|
709
|
+
"+ Model\n\n"\
|
710
|
+
" {}\n"\
|
711
|
+
"\n"\
|
712
|
+
"## List [GET]\n"\
|
713
|
+
"+ Response 200\n\n"\
|
714
|
+
" [Post][]\n";
|
715
|
+
|
716
|
+
ParseResult<Blueprint> blueprint;
|
717
|
+
parse(source, 0, blueprint);
|
718
|
+
|
719
|
+
REQUIRE(blueprint.report.error.code == SymbolError);
|
720
|
+
REQUIRE(blueprint.report.warnings.empty());
|
721
|
+
}
|
722
|
+
|
723
|
+
TEST_CASE("Parse root resource", "[resource]")
|
724
|
+
{
|
725
|
+
mdp::ByteBuffer source = "# API Root [/]\n";
|
726
|
+
|
727
|
+
ParseResult<Resource> resource;
|
728
|
+
SectionParserHelper<Resource, ResourceParser>::parse(source, ResourceSectionType, resource, ExportSourcemapOption);
|
729
|
+
|
730
|
+
REQUIRE(resource.report.error.code == Error::OK);
|
731
|
+
REQUIRE(resource.report.warnings.empty());
|
732
|
+
|
733
|
+
REQUIRE(resource.node.name == "API Root");
|
734
|
+
REQUIRE(resource.node.uriTemplate == "/");
|
735
|
+
REQUIRE(resource.node.actions.empty());
|
736
|
+
|
737
|
+
REQUIRE(resource.sourceMap.name.sourceMap.size() == 1);
|
738
|
+
REQUIRE(resource.sourceMap.name.sourceMap[0].location == 0);
|
739
|
+
REQUIRE(resource.sourceMap.name.sourceMap[0].length == 15);
|
740
|
+
REQUIRE(resource.sourceMap.description.sourceMap.empty());
|
741
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap.size() == 1);
|
742
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].location == 0);
|
743
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].length == 15);
|
744
|
+
REQUIRE(resource.sourceMap.parameters.collection.empty());
|
745
|
+
REQUIRE(resource.sourceMap.actions.collection.empty());
|
746
|
+
}
|
747
|
+
|
748
|
+
TEST_CASE("Parse resource with invalid URI Tempalte", "[resource]")
|
749
|
+
{
|
750
|
+
mdp::ByteBuffer source = "# Resource [/id{? limit}]\n";
|
751
|
+
|
752
|
+
ParseResult<Resource> resource;
|
753
|
+
SectionParserHelper<Resource, ResourceParser>::parse(source, ResourceSectionType, resource, ExportSourcemapOption);
|
754
|
+
|
755
|
+
REQUIRE(resource.report.error.code == Error::OK);
|
756
|
+
REQUIRE(resource.report.warnings.size() == 1);
|
757
|
+
REQUIRE(resource.report.warnings[0].code == URIWarning);
|
758
|
+
|
759
|
+
REQUIRE(resource.node.name == "Resource");
|
760
|
+
REQUIRE(resource.node.uriTemplate == "/id{? limit}");
|
761
|
+
REQUIRE(resource.node.actions.empty());
|
762
|
+
|
763
|
+
REQUIRE(resource.sourceMap.name.sourceMap.size() == 1);
|
764
|
+
REQUIRE(resource.sourceMap.name.sourceMap[0].location == 0);
|
765
|
+
REQUIRE(resource.sourceMap.name.sourceMap[0].length == 26);
|
766
|
+
REQUIRE(resource.sourceMap.description.sourceMap.empty());
|
767
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap.size() == 1);
|
768
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].location == 0);
|
769
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].length == 26);
|
770
|
+
REQUIRE(resource.sourceMap.parameters.collection.empty());
|
771
|
+
REQUIRE(resource.sourceMap.actions.collection.empty());
|
772
|
+
}
|
773
|
+
|
774
|
+
TEST_CASE("Deprecated resource and action headers", "[resource]")
|
775
|
+
{
|
776
|
+
mdp::ByteBuffer source = \
|
777
|
+
"# /\n"\
|
778
|
+
"+ Headers\n\n"\
|
779
|
+
" header1: value1\n\n"\
|
780
|
+
"## GET\n"\
|
781
|
+
"+ Headers\n\n"\
|
782
|
+
" header2: value2\n\n"\
|
783
|
+
"+ Response 200\n"\
|
784
|
+
" + Headers\n\n"\
|
785
|
+
" header3: value3\n\n";
|
786
|
+
|
787
|
+
ParseResult<Resource> resource;
|
788
|
+
SectionParserHelper<Resource, ResourceParser>::parse(source, ResourceSectionType, resource, ExportSourcemapOption);
|
789
|
+
|
790
|
+
REQUIRE(resource.report.error.code == Error::OK);
|
791
|
+
REQUIRE(resource.report.warnings.size() == 2);
|
792
|
+
REQUIRE(resource.report.warnings[0].code == DeprecatedWarning);
|
793
|
+
REQUIRE(resource.report.warnings[1].code == DeprecatedWarning);
|
794
|
+
|
795
|
+
REQUIRE(resource.node.headers.empty());
|
796
|
+
REQUIRE(resource.node.actions.size() == 1);
|
797
|
+
REQUIRE(resource.node.actions[0].headers.empty());
|
798
|
+
REQUIRE(resource.node.actions[0].examples.size() == 1);
|
799
|
+
REQUIRE(resource.node.actions[0].examples[0].responses.size() == 1);
|
800
|
+
REQUIRE(resource.node.actions[0].examples[0].responses[0].headers.size() == 3);
|
801
|
+
REQUIRE(resource.node.actions[0].examples[0].responses[0].headers[0].first == "header1");
|
802
|
+
REQUIRE(resource.node.actions[0].examples[0].responses[0].headers[0].second == "value1");
|
803
|
+
REQUIRE(resource.node.actions[0].examples[0].responses[0].headers[1].first == "header2");
|
804
|
+
REQUIRE(resource.node.actions[0].examples[0].responses[0].headers[1].second == "value2");
|
805
|
+
REQUIRE(resource.node.actions[0].examples[0].responses[0].headers[2].first == "header3");
|
806
|
+
REQUIRE(resource.node.actions[0].examples[0].responses[0].headers[2].second == "value3");
|
807
|
+
|
808
|
+
REQUIRE(resource.sourceMap.name.sourceMap.empty());
|
809
|
+
REQUIRE(resource.sourceMap.description.sourceMap.empty());
|
810
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap.size() == 1);
|
811
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].location == 0);
|
812
|
+
REQUIRE(resource.sourceMap.uriTemplate.sourceMap[0].length == 4);
|
813
|
+
REQUIRE(resource.sourceMap.parameters.collection.empty());
|
814
|
+
REQUIRE(resource.sourceMap.headers.collection.empty());
|
815
|
+
REQUIRE(resource.sourceMap.actions.collection.size() == 1);
|
816
|
+
REQUIRE(resource.sourceMap.actions.collection[0].headers.collection.empty());
|
817
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection.size() == 1);
|
818
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection[0].responses.collection.size() == 1);
|
819
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection[0].responses.collection[0].headers.collection.size() == 3);
|
820
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection[0].responses.collection[0].headers.collection[0].sourceMap.size() == 1);
|
821
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection[0].responses.collection[0].headers.collection[0].sourceMap[0].location == 19);
|
822
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection[0].responses.collection[0].headers.collection[0].sourceMap[0].length == 20);
|
823
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection[0].responses.collection[0].headers.collection[1].sourceMap.size() == 1);
|
824
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection[0].responses.collection[0].headers.collection[1].sourceMap[0].location == 62);
|
825
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection[0].responses.collection[0].headers.collection[1].sourceMap[0].length == 20);
|
826
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection[0].responses.collection[0].headers.collection[2].sourceMap.size() == 1);
|
827
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection[0].responses.collection[0].headers.collection[2].sourceMap[0].location == 121);
|
828
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection[0].responses.collection[0].headers.collection[2].sourceMap[0].length == 20);
|
829
|
+
}
|
830
|
+
|
831
|
+
TEST_CASE("Bug fix for recognition of model as a part of other word or as a quote, issue #92 and #152", "[model]")
|
832
|
+
{
|
833
|
+
mdp::ByteBuffer source = \
|
834
|
+
"## Resource [/resource]\n"\
|
835
|
+
"### Attributes\n"\
|
836
|
+
"- A\n"\
|
837
|
+
"- Cmodel\n"\
|
838
|
+
"- Single data model for all exchange data\n"\
|
839
|
+
"- `model`\n";
|
840
|
+
|
841
|
+
ParseResult<Resource> resource;
|
842
|
+
SectionParserHelper<Resource, ResourceParser>::parse(source, ResourceSectionType, resource);
|
843
|
+
|
844
|
+
REQUIRE(resource.report.error.code == Error::OK);
|
845
|
+
REQUIRE(resource.report.warnings.size() == 0);
|
846
|
+
|
847
|
+
REQUIRE(resource.node.name == "Resource");
|
848
|
+
REQUIRE(resource.node.description == "### Attributes\n\n- A\n\n- Cmodel\n\n- Single data model for all exchange data\n\n- `model`\n");
|
849
|
+
}
|
850
|
+
|
851
|
+
TEST_CASE("Parse resource with multi-word named model", "[resource][model]")
|
852
|
+
{
|
853
|
+
mdp::ByteBuffer source = \
|
854
|
+
"# My Resource [/resource]\n\n"\
|
855
|
+
"Awesome description\n\n"\
|
856
|
+
"+ a really good name Model (text/plain)\n\n"\
|
857
|
+
" body of the `model`\n";
|
858
|
+
|
859
|
+
ParseResult<Resource> resource;
|
860
|
+
SectionParserHelper<Resource, ResourceParser>::parse(source, ResourceSectionType, resource);
|
861
|
+
|
862
|
+
REQUIRE(resource.report.error.code == Error::OK);
|
863
|
+
REQUIRE(resource.report.warnings.empty());
|
864
|
+
|
865
|
+
REQUIRE(resource.node.model.name == "a really good name");
|
866
|
+
REQUIRE(resource.node.model.body == "body of the `model`\n");
|
867
|
+
REQUIRE(resource.node.actions.empty());
|
868
|
+
}
|
869
|
+
|
870
|
+
TEST_CASE("Dangling transaction example assets", "[resource]")
|
871
|
+
{
|
872
|
+
mdp::ByteBuffer source = \
|
873
|
+
"# A [/a]\n"\
|
874
|
+
"## GET\n"\
|
875
|
+
"+ Request A\n"\
|
876
|
+
"\n"\
|
877
|
+
"```js\n"\
|
878
|
+
"dangling request body\n"\
|
879
|
+
"```\n"\
|
880
|
+
"\n"\
|
881
|
+
"+ Response 200\n"\
|
882
|
+
"\n"\
|
883
|
+
"```\n"\
|
884
|
+
"dangling response body\n"\
|
885
|
+
"```\n";
|
886
|
+
|
887
|
+
ParseResult<Resource> resource;
|
888
|
+
SectionParserHelper<Resource, ResourceParser>::parse(source, ResourceSectionType, resource, ExportSourcemapOption);
|
889
|
+
|
890
|
+
REQUIRE(resource.report.error.code == Error::OK);
|
891
|
+
REQUIRE(resource.report.warnings.size() == 3);
|
892
|
+
REQUIRE(resource.report.warnings[0].code == EmptyDefinitionWarning);
|
893
|
+
REQUIRE(resource.report.warnings[1].code == IndentationWarning);
|
894
|
+
REQUIRE(resource.report.warnings[2].code == IndentationWarning);
|
895
|
+
|
896
|
+
REQUIRE(resource.node.name == "A");
|
897
|
+
REQUIRE(resource.node.uriTemplate == "/a");
|
898
|
+
REQUIRE(resource.node.actions.size() == 1);
|
899
|
+
|
900
|
+
REQUIRE(resource.node.actions[0].method == "GET");
|
901
|
+
REQUIRE(resource.node.actions[0].examples.size() == 1);
|
902
|
+
REQUIRE(resource.node.actions[0].examples[0].requests.size() == 1);
|
903
|
+
REQUIRE(resource.node.actions[0].examples[0].requests[0].name == "A");
|
904
|
+
REQUIRE(resource.node.actions[0].examples[0].requests[0].body == "dangling request body\n\n");
|
905
|
+
|
906
|
+
REQUIRE(resource.node.actions[0].examples[0].responses.size() == 1);
|
907
|
+
REQUIRE(resource.node.actions[0].examples[0].responses[0].name == "200");
|
908
|
+
REQUIRE(resource.node.actions[0].examples[0].responses[0].body == "dangling response body\n\n");
|
909
|
+
|
910
|
+
REQUIRE(resource.sourceMap.actions.collection.size() == 1);
|
911
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection.size() == 1);
|
912
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection[0].requests.collection.size() == 1);
|
913
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection[0].requests.collection[0].body.sourceMap.size() == 1);
|
914
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection[0].requests.collection[0].body.sourceMap[0].location == 29);
|
915
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection[0].requests.collection[0].body.sourceMap[0].length == 33);
|
916
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection[0].responses.collection.size() == 1);
|
917
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection[0].responses.collection[0].body.sourceMap.size() == 1);
|
918
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection[0].responses.collection[0].body.sourceMap[0].location == 78);
|
919
|
+
REQUIRE(resource.sourceMap.actions.collection[0].examples.collection[0].responses.collection[0].body.sourceMap[0].length == 31);
|
920
|
+
}
|
921
|
+
|
922
|
+
TEST_CASE("Body list item in description", "[resource][regression][#190]")
|
923
|
+
{
|
924
|
+
mdp::ByteBuffer source = \
|
925
|
+
"## GET /A\n"\
|
926
|
+
"Lorem Ipsum\n"\
|
927
|
+
"\n"\
|
928
|
+
"+ Body\n"\
|
929
|
+
"\n"\
|
930
|
+
" { ... }\n"\
|
931
|
+
"\n"\
|
932
|
+
"+ Response 200\n";
|
933
|
+
|
934
|
+
ParseResult<Resource> resource;
|
935
|
+
SectionParserHelper<Resource, ResourceParser>::parse(source, ResourceSectionType, resource, ExportSourcemapOption);
|
936
|
+
|
937
|
+
REQUIRE(resource.report.error.code == Error::OK);
|
938
|
+
REQUIRE(resource.report.warnings.empty());
|
939
|
+
|
940
|
+
REQUIRE(resource.node.actions.size() == 1);
|
941
|
+
REQUIRE(resource.node.actions[0].description == "Lorem Ipsum\n\n+ Body\n\n { ... }\n\n");
|
942
|
+
|
943
|
+
REQUIRE(resource.sourceMap.actions.collection.size() == 1);
|
944
|
+
REQUIRE(resource.sourceMap.actions.collection[0].description.sourceMap.size() == 1);
|
945
|
+
REQUIRE(resource.sourceMap.actions.collection[0].description.sourceMap[0].location == 10);
|
946
|
+
REQUIRE(resource.sourceMap.actions.collection[0].description.sourceMap[0].length == 34);
|
947
|
+
}
|