From: Alex Lorenz Date: Thu, 7 May 2015 18:08:46 +0000 (+0000) Subject: YAML: Enable the YAMLParser tests. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9e31c0cf91532c1e39055d2b6352f196959a2a13;p=oota-llvm.git YAML: Enable the YAMLParser tests. This commit enables the tests located in test/YAMLParser directory. Those tests were never actually enabled, as llvm-lit didn't pick up the files with the 'data' extension. The commit renames those test files to files with the 'test' extension so that llvm-lit would find them. This commit also modifies yaml-bench so that it returns an error status if an error occurred during parsing. It also adds the '-use-color' command line option to yaml-bench (to make sure that file check matches the error messages in the output stream). This commit modifies some of the renamed tests so that they wouldn't fail. It gets rid of XFAILs and uses the 'not' command instead for some of the tests that have to fail during parsing. This commit also adds some 'FIXME' comments to a couple of tests that are supposed to fail but currently pass because of various bugs in the implementation of the yaml parser. Reviewers: Justin Bogner Differential Revision: http://reviews.llvm.org/D9448 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236754 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/YAMLParser.h b/include/llvm/Support/YAMLParser.h index db888b816cf..37becaa7b6d 100644 --- a/include/llvm/Support/YAMLParser.h +++ b/include/llvm/Support/YAMLParser.h @@ -76,9 +76,9 @@ std::string escape(StringRef Input); class Stream { public: /// \brief This keeps a reference to the string referenced by \p Input. - Stream(StringRef Input, SourceMgr &); + Stream(StringRef Input, SourceMgr &, bool ShowColors = true); - Stream(MemoryBufferRef InputBuffer, SourceMgr &); + Stream(MemoryBufferRef InputBuffer, SourceMgr &, bool ShowColors = true); ~Stream(); document_iterator begin(); diff --git a/lib/Support/YAMLParser.cpp b/lib/Support/YAMLParser.cpp index cb21eb58e94..83c96510846 100644 --- a/lib/Support/YAMLParser.cpp +++ b/lib/Support/YAMLParser.cpp @@ -260,8 +260,8 @@ namespace yaml { /// @brief Scans YAML tokens from a MemoryBuffer. class Scanner { public: - Scanner(StringRef Input, SourceMgr &SM); - Scanner(MemoryBufferRef Buffer, SourceMgr &SM_); + Scanner(StringRef Input, SourceMgr &SM, bool ShowColors = true); + Scanner(MemoryBufferRef Buffer, SourceMgr &SM_, bool ShowColors = true); /// @brief Parse the next token and return it without popping it. Token &peekNext(); @@ -271,7 +271,7 @@ public: void printError(SMLoc Loc, SourceMgr::DiagKind Kind, const Twine &Message, ArrayRef Ranges = None) { - SM.PrintMessage(Loc, Kind, Message, Ranges); + SM.PrintMessage(Loc, Kind, Message, Ranges, /* FixIts= */ None, ShowColors); } void setError(const Twine &Message, StringRef::iterator Position) { @@ -505,6 +505,9 @@ private: /// @brief True if an error has occurred. bool Failed; + /// @brief Should colors be used when printing out the diagnostic messages? + bool ShowColors; + /// @brief Queue of tokens. This is required to queue up tokens while looking /// for the end of a simple key. And for cases where a single character /// can produce multiple tokens (e.g. BlockEnd). @@ -706,11 +709,13 @@ std::string yaml::escape(StringRef Input) { return EscapedInput; } -Scanner::Scanner(StringRef Input, SourceMgr &sm) : SM(sm) { +Scanner::Scanner(StringRef Input, SourceMgr &sm, bool ShowColors) + : SM(sm), ShowColors(ShowColors) { init(MemoryBufferRef(Input, "YAML")); } -Scanner::Scanner(MemoryBufferRef Buffer, SourceMgr &SM_) : SM(SM_) { +Scanner::Scanner(MemoryBufferRef Buffer, SourceMgr &SM_, bool ShowColors) + : SM(SM_), ShowColors(ShowColors) { init(Buffer); } @@ -1525,11 +1530,11 @@ bool Scanner::fetchMoreTokens() { return false; } -Stream::Stream(StringRef Input, SourceMgr &SM) - : scanner(new Scanner(Input, SM)), CurrentDoc() {} +Stream::Stream(StringRef Input, SourceMgr &SM, bool ShowColors) + : scanner(new Scanner(Input, SM, ShowColors)), CurrentDoc() {} -Stream::Stream(MemoryBufferRef InputBuffer, SourceMgr &SM) - : scanner(new Scanner(InputBuffer, SM)), CurrentDoc() {} +Stream::Stream(MemoryBufferRef InputBuffer, SourceMgr &SM, bool ShowColors) + : scanner(new Scanner(InputBuffer, SM, ShowColors)), CurrentDoc() {} Stream::~Stream() {} diff --git a/test/YAMLParser/bool.data b/test/YAMLParser/bool.data deleted file mode 100644 index e987a0ec1e3..00000000000 --- a/test/YAMLParser/bool.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- yes -- NO -- True -- on diff --git a/test/YAMLParser/bool.test b/test/YAMLParser/bool.test new file mode 100644 index 00000000000..e987a0ec1e3 --- /dev/null +++ b/test/YAMLParser/bool.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +- yes +- NO +- True +- on diff --git a/test/YAMLParser/construct-bool.data b/test/YAMLParser/construct-bool.data deleted file mode 100644 index 035ec0c8580..00000000000 --- a/test/YAMLParser/construct-bool.data +++ /dev/null @@ -1,11 +0,0 @@ -# RUN: yaml-bench -canonical %s - -canonical: yes -answer: NO -logical: True -option: on - - -but: - y: is a string - n: is a string diff --git a/test/YAMLParser/construct-bool.test b/test/YAMLParser/construct-bool.test new file mode 100644 index 00000000000..035ec0c8580 --- /dev/null +++ b/test/YAMLParser/construct-bool.test @@ -0,0 +1,11 @@ +# RUN: yaml-bench -canonical %s + +canonical: yes +answer: NO +logical: True +option: on + + +but: + y: is a string + n: is a string diff --git a/test/YAMLParser/construct-custom.data b/test/YAMLParser/construct-custom.data deleted file mode 100644 index cac95e0a5fb..00000000000 --- a/test/YAMLParser/construct-custom.data +++ /dev/null @@ -1,28 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- -- !tag1 - x: 1 -- !tag1 - x: 1 - 'y': 2 - z: 3 -- !tag2 - 10 -- !tag2 - =: 10 - 'y': 20 - z: 30 -- !tag3 - x: 1 -- !tag3 - x: 1 - 'y': 2 - z: 3 -- !tag3 - =: 1 - 'y': 2 - z: 3 -- !foo - my-parameter: foo - my-another-parameter: [1,2,3] diff --git a/test/YAMLParser/construct-custom.test b/test/YAMLParser/construct-custom.test new file mode 100644 index 00000000000..cac95e0a5fb --- /dev/null +++ b/test/YAMLParser/construct-custom.test @@ -0,0 +1,28 @@ +# RUN: yaml-bench -canonical %s + +--- +- !tag1 + x: 1 +- !tag1 + x: 1 + 'y': 2 + z: 3 +- !tag2 + 10 +- !tag2 + =: 10 + 'y': 20 + z: 30 +- !tag3 + x: 1 +- !tag3 + x: 1 + 'y': 2 + z: 3 +- !tag3 + =: 1 + 'y': 2 + z: 3 +- !foo + my-parameter: foo + my-another-parameter: [1,2,3] diff --git a/test/YAMLParser/construct-float.data b/test/YAMLParser/construct-float.data deleted file mode 100644 index 07c51bdd833..00000000000 --- a/test/YAMLParser/construct-float.data +++ /dev/null @@ -1,8 +0,0 @@ -# RUN: yaml-bench -canonical %s - -canonical: 6.8523015e+5 -exponential: 685.230_15e+03 -fixed: 685_230.15 -sexagesimal: 190:20:30.15 -negative infinity: -.inf -not a number: .NaN diff --git a/test/YAMLParser/construct-float.test b/test/YAMLParser/construct-float.test new file mode 100644 index 00000000000..07c51bdd833 --- /dev/null +++ b/test/YAMLParser/construct-float.test @@ -0,0 +1,8 @@ +# RUN: yaml-bench -canonical %s + +canonical: 6.8523015e+5 +exponential: 685.230_15e+03 +fixed: 685_230.15 +sexagesimal: 190:20:30.15 +negative infinity: -.inf +not a number: .NaN diff --git a/test/YAMLParser/construct-int.data b/test/YAMLParser/construct-int.data deleted file mode 100644 index b14c37f7880..00000000000 --- a/test/YAMLParser/construct-int.data +++ /dev/null @@ -1,8 +0,0 @@ -# RUN: yaml-bench -canonical %s - -canonical: 685230 -decimal: +685_230 -octal: 02472256 -hexadecimal: 0x_0A_74_AE -binary: 0b1010_0111_0100_1010_1110 -sexagesimal: 190:20:30 diff --git a/test/YAMLParser/construct-int.test b/test/YAMLParser/construct-int.test new file mode 100644 index 00000000000..b14c37f7880 --- /dev/null +++ b/test/YAMLParser/construct-int.test @@ -0,0 +1,8 @@ +# RUN: yaml-bench -canonical %s + +canonical: 685230 +decimal: +685_230 +octal: 02472256 +hexadecimal: 0x_0A_74_AE +binary: 0b1010_0111_0100_1010_1110 +sexagesimal: 190:20:30 diff --git a/test/YAMLParser/construct-map.data b/test/YAMLParser/construct-map.data deleted file mode 100644 index 1b681206d17..00000000000 --- a/test/YAMLParser/construct-map.data +++ /dev/null @@ -1,8 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# Unordered set of key: value pairs. -Block style: !!map - Clark : Evans - Brian : Ingerson - Oren : Ben-Kiki -Flow style: !!map { Clark: Evans, Brian: Ingerson, Oren: Ben-Kiki } diff --git a/test/YAMLParser/construct-map.test b/test/YAMLParser/construct-map.test new file mode 100644 index 00000000000..1b681206d17 --- /dev/null +++ b/test/YAMLParser/construct-map.test @@ -0,0 +1,8 @@ +# RUN: yaml-bench -canonical %s + +# Unordered set of key: value pairs. +Block style: !!map + Clark : Evans + Brian : Ingerson + Oren : Ben-Kiki +Flow style: !!map { Clark: Evans, Brian: Ingerson, Oren: Ben-Kiki } diff --git a/test/YAMLParser/construct-merge.data b/test/YAMLParser/construct-merge.data deleted file mode 100644 index 0ebc9f612d5..00000000000 --- a/test/YAMLParser/construct-merge.data +++ /dev/null @@ -1,29 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- -- &CENTER { x: 1, 'y': 2 } -- &LEFT { x: 0, 'y': 2 } -- &BIG { r: 10 } -- &SMALL { r: 1 } - -# All the following maps are equal: - -- # Explicit keys - x: 1 - 'y': 2 - r: 10 - label: center/big - -- # Merge one map - << : *CENTER - r: 10 - label: center/big - -- # Merge multiple maps - << : [ *CENTER, *BIG ] - label: center/big - -- # Override - << : [ *BIG, *LEFT, *SMALL ] - x: 1 - label: center/big diff --git a/test/YAMLParser/construct-merge.test b/test/YAMLParser/construct-merge.test new file mode 100644 index 00000000000..0ebc9f612d5 --- /dev/null +++ b/test/YAMLParser/construct-merge.test @@ -0,0 +1,29 @@ +# RUN: yaml-bench -canonical %s + +--- +- &CENTER { x: 1, 'y': 2 } +- &LEFT { x: 0, 'y': 2 } +- &BIG { r: 10 } +- &SMALL { r: 1 } + +# All the following maps are equal: + +- # Explicit keys + x: 1 + 'y': 2 + r: 10 + label: center/big + +- # Merge one map + << : *CENTER + r: 10 + label: center/big + +- # Merge multiple maps + << : [ *CENTER, *BIG ] + label: center/big + +- # Override + << : [ *BIG, *LEFT, *SMALL ] + x: 1 + label: center/big diff --git a/test/YAMLParser/construct-null.data b/test/YAMLParser/construct-null.data deleted file mode 100644 index 51f8b61e24e..00000000000 --- a/test/YAMLParser/construct-null.data +++ /dev/null @@ -1,20 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# A document may be null. ---- ---- -# This mapping has four keys, -# one has a value. -empty: -canonical: ~ -english: null -~: null key ---- -# This sequence has five -# entries, two have values. -sparse: - - ~ - - 2nd entry - - - - 4th entry - - Null diff --git a/test/YAMLParser/construct-null.test b/test/YAMLParser/construct-null.test new file mode 100644 index 00000000000..51f8b61e24e --- /dev/null +++ b/test/YAMLParser/construct-null.test @@ -0,0 +1,20 @@ +# RUN: yaml-bench -canonical %s + +# A document may be null. +--- +--- +# This mapping has four keys, +# one has a value. +empty: +canonical: ~ +english: null +~: null key +--- +# This sequence has five +# entries, two have values. +sparse: + - ~ + - 2nd entry + - + - 4th entry + - Null diff --git a/test/YAMLParser/construct-omap.data b/test/YAMLParser/construct-omap.data deleted file mode 100644 index b96d6799c7d..00000000000 --- a/test/YAMLParser/construct-omap.data +++ /dev/null @@ -1,10 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# Explicitly typed ordered map (dictionary). -Bestiary: !!omap - - aardvark: African pig-like ant eater. Ugly. - - anteater: South-American ant eater. Two species. - - anaconda: South-American constrictor snake. Scaly. - # Etc. -# Flow style -Numbers: !!omap [ one: 1, two: 2, three : 3 ] diff --git a/test/YAMLParser/construct-omap.test b/test/YAMLParser/construct-omap.test new file mode 100644 index 00000000000..b96d6799c7d --- /dev/null +++ b/test/YAMLParser/construct-omap.test @@ -0,0 +1,10 @@ +# RUN: yaml-bench -canonical %s + +# Explicitly typed ordered map (dictionary). +Bestiary: !!omap + - aardvark: African pig-like ant eater. Ugly. + - anteater: South-American ant eater. Two species. + - anaconda: South-American constrictor snake. Scaly. + # Etc. +# Flow style +Numbers: !!omap [ one: 1, two: 2, three : 3 ] diff --git a/test/YAMLParser/construct-pairs.data b/test/YAMLParser/construct-pairs.data deleted file mode 100644 index 40f288d1d74..00000000000 --- a/test/YAMLParser/construct-pairs.data +++ /dev/null @@ -1,9 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# Explicitly typed pairs. -Block tasks: !!pairs - - meeting: with team. - - meeting: with boss. - - break: lunch. - - meeting: with client. -Flow tasks: !!pairs [ meeting: with team, meeting: with boss ] diff --git a/test/YAMLParser/construct-pairs.test b/test/YAMLParser/construct-pairs.test new file mode 100644 index 00000000000..40f288d1d74 --- /dev/null +++ b/test/YAMLParser/construct-pairs.test @@ -0,0 +1,9 @@ +# RUN: yaml-bench -canonical %s + +# Explicitly typed pairs. +Block tasks: !!pairs + - meeting: with team. + - meeting: with boss. + - break: lunch. + - meeting: with client. +Flow tasks: !!pairs [ meeting: with team, meeting: with boss ] diff --git a/test/YAMLParser/construct-seq.data b/test/YAMLParser/construct-seq.data deleted file mode 100644 index f43fd39f8ed..00000000000 --- a/test/YAMLParser/construct-seq.data +++ /dev/null @@ -1,17 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# Ordered sequence of nodes -Block style: !!seq -- Mercury # Rotates - no light/dark sides. -- Venus # Deadliest. Aptly named. -- Earth # Mostly dirt. -- Mars # Seems empty. -- Jupiter # The king. -- Saturn # Pretty. -- Uranus # Where the sun hardly shines. -- Neptune # Boring. No rings. -- Pluto # You call this a planet? -Flow style: !!seq [ Mercury, Venus, Earth, Mars, # Rocks - Jupiter, Saturn, Uranus, Neptune, # Gas - Pluto ] # Overrated - diff --git a/test/YAMLParser/construct-seq.test b/test/YAMLParser/construct-seq.test new file mode 100644 index 00000000000..f43fd39f8ed --- /dev/null +++ b/test/YAMLParser/construct-seq.test @@ -0,0 +1,17 @@ +# RUN: yaml-bench -canonical %s + +# Ordered sequence of nodes +Block style: !!seq +- Mercury # Rotates - no light/dark sides. +- Venus # Deadliest. Aptly named. +- Earth # Mostly dirt. +- Mars # Seems empty. +- Jupiter # The king. +- Saturn # Pretty. +- Uranus # Where the sun hardly shines. +- Neptune # Boring. No rings. +- Pluto # You call this a planet? +Flow style: !!seq [ Mercury, Venus, Earth, Mars, # Rocks + Jupiter, Saturn, Uranus, Neptune, # Gas + Pluto ] # Overrated + diff --git a/test/YAMLParser/construct-set.data b/test/YAMLParser/construct-set.data deleted file mode 100644 index 3e9d095e714..00000000000 --- a/test/YAMLParser/construct-set.data +++ /dev/null @@ -1,9 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# Explicitly typed set. -baseball players: !!set - ? Mark McGwire - ? Sammy Sosa - ? Ken Griffey -# Flow style -baseball teams: !!set { Boston Red Sox, Detroit Tigers, New York Yankees } diff --git a/test/YAMLParser/construct-set.test b/test/YAMLParser/construct-set.test new file mode 100644 index 00000000000..3e9d095e714 --- /dev/null +++ b/test/YAMLParser/construct-set.test @@ -0,0 +1,9 @@ +# RUN: yaml-bench -canonical %s + +# Explicitly typed set. +baseball players: !!set + ? Mark McGwire + ? Sammy Sosa + ? Ken Griffey +# Flow style +baseball teams: !!set { Boston Red Sox, Detroit Tigers, New York Yankees } diff --git a/test/YAMLParser/construct-str-ascii.data b/test/YAMLParser/construct-str-ascii.data deleted file mode 100644 index 24290ae8a99..00000000000 --- a/test/YAMLParser/construct-str-ascii.data +++ /dev/null @@ -1,3 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- !!str "ascii string" diff --git a/test/YAMLParser/construct-str-ascii.test b/test/YAMLParser/construct-str-ascii.test new file mode 100644 index 00000000000..24290ae8a99 --- /dev/null +++ b/test/YAMLParser/construct-str-ascii.test @@ -0,0 +1,3 @@ +# RUN: yaml-bench -canonical %s + +--- !!str "ascii string" diff --git a/test/YAMLParser/construct-str.data b/test/YAMLParser/construct-str.data deleted file mode 100644 index dc1ce825cdc..00000000000 --- a/test/YAMLParser/construct-str.data +++ /dev/null @@ -1,3 +0,0 @@ -# RUN: yaml-bench -canonical %s - -string: abcd diff --git a/test/YAMLParser/construct-str.test b/test/YAMLParser/construct-str.test new file mode 100644 index 00000000000..dc1ce825cdc --- /dev/null +++ b/test/YAMLParser/construct-str.test @@ -0,0 +1,3 @@ +# RUN: yaml-bench -canonical %s + +string: abcd diff --git a/test/YAMLParser/construct-timestamp.data b/test/YAMLParser/construct-timestamp.data deleted file mode 100644 index f262c2d02c0..00000000000 --- a/test/YAMLParser/construct-timestamp.data +++ /dev/null @@ -1,7 +0,0 @@ -# RUN: yaml-bench -canonical %s - -canonical: 2001-12-15T02:59:43.1Z -valid iso8601: 2001-12-14t21:59:43.10-05:00 -space separated: 2001-12-14 21:59:43.10 -5 -no time zone (Z): 2001-12-15 2:59:43.10 -date (00:00:00Z): 2002-12-14 diff --git a/test/YAMLParser/construct-timestamp.test b/test/YAMLParser/construct-timestamp.test new file mode 100644 index 00000000000..f262c2d02c0 --- /dev/null +++ b/test/YAMLParser/construct-timestamp.test @@ -0,0 +1,7 @@ +# RUN: yaml-bench -canonical %s + +canonical: 2001-12-15T02:59:43.1Z +valid iso8601: 2001-12-14t21:59:43.10-05:00 +space separated: 2001-12-14 21:59:43.10 -5 +no time zone (Z): 2001-12-15 2:59:43.10 +date (00:00:00Z): 2002-12-14 diff --git a/test/YAMLParser/construct-value.data b/test/YAMLParser/construct-value.data deleted file mode 100644 index fe01a0dc904..00000000000 --- a/test/YAMLParser/construct-value.data +++ /dev/null @@ -1,12 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- # Old schema -link with: - - library1.dll - - library2.dll ---- # New schema -link with: - - = : library1.dll - version: 1.2 - - = : library2.dll - version: 2.3 diff --git a/test/YAMLParser/construct-value.test b/test/YAMLParser/construct-value.test new file mode 100644 index 00000000000..fe01a0dc904 --- /dev/null +++ b/test/YAMLParser/construct-value.test @@ -0,0 +1,12 @@ +# RUN: yaml-bench -canonical %s + +--- # Old schema +link with: + - library1.dll + - library2.dll +--- # New schema +link with: + - = : library1.dll + version: 1.2 + - = : library2.dll + version: 2.3 diff --git a/test/YAMLParser/duplicate-key.former-loader-error.data b/test/YAMLParser/duplicate-key.former-loader-error.data deleted file mode 100644 index 9272103fe65..00000000000 --- a/test/YAMLParser/duplicate-key.former-loader-error.data +++ /dev/null @@ -1,5 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- -foo: bar -foo: baz diff --git a/test/YAMLParser/duplicate-key.former-loader-error.test b/test/YAMLParser/duplicate-key.former-loader-error.test new file mode 100644 index 00000000000..9272103fe65 --- /dev/null +++ b/test/YAMLParser/duplicate-key.former-loader-error.test @@ -0,0 +1,5 @@ +# RUN: yaml-bench -canonical %s + +--- +foo: bar +foo: baz diff --git a/test/YAMLParser/duplicate-mapping-key.former-loader-error.data b/test/YAMLParser/duplicate-mapping-key.former-loader-error.data deleted file mode 100644 index 96d175d2ac1..00000000000 --- a/test/YAMLParser/duplicate-mapping-key.former-loader-error.data +++ /dev/null @@ -1,8 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- -&anchor foo: - foo: bar - *anchor: duplicate key - baz: bat - *anchor: duplicate key diff --git a/test/YAMLParser/duplicate-mapping-key.former-loader-error.test b/test/YAMLParser/duplicate-mapping-key.former-loader-error.test new file mode 100644 index 00000000000..96d175d2ac1 --- /dev/null +++ b/test/YAMLParser/duplicate-mapping-key.former-loader-error.test @@ -0,0 +1,8 @@ +# RUN: yaml-bench -canonical %s + +--- +&anchor foo: + foo: bar + *anchor: duplicate key + baz: bat + *anchor: duplicate key diff --git a/test/YAMLParser/duplicate-merge-key.former-loader-error.data b/test/YAMLParser/duplicate-merge-key.former-loader-error.data deleted file mode 100644 index 6b1276436ab..00000000000 --- a/test/YAMLParser/duplicate-merge-key.former-loader-error.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- -<<: {x: 1, y: 2} -foo: bar -<<: {z: 3, t: 4} diff --git a/test/YAMLParser/duplicate-merge-key.former-loader-error.test b/test/YAMLParser/duplicate-merge-key.former-loader-error.test new file mode 100644 index 00000000000..6b1276436ab --- /dev/null +++ b/test/YAMLParser/duplicate-merge-key.former-loader-error.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +--- +<<: {x: 1, y: 2} +foo: bar +<<: {z: 3, t: 4} diff --git a/test/YAMLParser/duplicate-value-key.former-loader-error.data b/test/YAMLParser/duplicate-value-key.former-loader-error.data deleted file mode 100644 index dc20e0b275c..00000000000 --- a/test/YAMLParser/duplicate-value-key.former-loader-error.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- -=: 1 -foo: bar -=: 2 diff --git a/test/YAMLParser/duplicate-value-key.former-loader-error.test b/test/YAMLParser/duplicate-value-key.former-loader-error.test new file mode 100644 index 00000000000..dc20e0b275c --- /dev/null +++ b/test/YAMLParser/duplicate-value-key.former-loader-error.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +--- +=: 1 +foo: bar +=: 2 diff --git a/test/YAMLParser/emit-block-scalar-in-simple-key-context-bug.data b/test/YAMLParser/emit-block-scalar-in-simple-key-context-bug.data deleted file mode 100644 index f5adedb1350..00000000000 --- a/test/YAMLParser/emit-block-scalar-in-simple-key-context-bug.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - -? |- - foo -: |- - bar diff --git a/test/YAMLParser/emit-block-scalar-in-simple-key-context-bug.test b/test/YAMLParser/emit-block-scalar-in-simple-key-context-bug.test new file mode 100644 index 00000000000..f5adedb1350 --- /dev/null +++ b/test/YAMLParser/emit-block-scalar-in-simple-key-context-bug.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +? |- + foo +: |- + bar diff --git a/test/YAMLParser/empty-document-bug.data b/test/YAMLParser/empty-document-bug.data deleted file mode 100644 index fa131fe78ef..00000000000 --- a/test/YAMLParser/empty-document-bug.data +++ /dev/null @@ -1,2 +0,0 @@ -# RUN: yaml-bench -canonical %s - diff --git a/test/YAMLParser/empty-document-bug.test b/test/YAMLParser/empty-document-bug.test new file mode 100644 index 00000000000..fa131fe78ef --- /dev/null +++ b/test/YAMLParser/empty-document-bug.test @@ -0,0 +1,2 @@ +# RUN: yaml-bench -canonical %s + diff --git a/test/YAMLParser/float.data b/test/YAMLParser/float.data deleted file mode 100644 index c4de97037c8..00000000000 --- a/test/YAMLParser/float.data +++ /dev/null @@ -1,8 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- 6.8523015e+5 -- 685.230_15e+03 -- 685_230.15 -- 190:20:30.15 -- -.inf -- .NaN diff --git a/test/YAMLParser/float.test b/test/YAMLParser/float.test new file mode 100644 index 00000000000..c4de97037c8 --- /dev/null +++ b/test/YAMLParser/float.test @@ -0,0 +1,8 @@ +# RUN: yaml-bench -canonical %s + +- 6.8523015e+5 +- 685.230_15e+03 +- 685_230.15 +- 190:20:30.15 +- -.inf +- .NaN diff --git a/test/YAMLParser/int.data b/test/YAMLParser/int.data deleted file mode 100644 index 2651d096ff6..00000000000 --- a/test/YAMLParser/int.data +++ /dev/null @@ -1,8 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- 685230 -- +685_230 -- 02472256 -- 0x_0A_74_AE -- 0b1010_0111_0100_1010_1110 -- 190:20:30 diff --git a/test/YAMLParser/int.test b/test/YAMLParser/int.test new file mode 100644 index 00000000000..2651d096ff6 --- /dev/null +++ b/test/YAMLParser/int.test @@ -0,0 +1,8 @@ +# RUN: yaml-bench -canonical %s + +- 685230 +- +685_230 +- 02472256 +- 0x_0A_74_AE +- 0b1010_0111_0100_1010_1110 +- 190:20:30 diff --git a/test/YAMLParser/invalid-single-quote-bug.data b/test/YAMLParser/invalid-single-quote-bug.data deleted file mode 100644 index 3722a003dff..00000000000 --- a/test/YAMLParser/invalid-single-quote-bug.data +++ /dev/null @@ -1,4 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- "foo 'bar'" -- "foo\n'bar'" diff --git a/test/YAMLParser/invalid-single-quote-bug.test b/test/YAMLParser/invalid-single-quote-bug.test new file mode 100644 index 00000000000..3722a003dff --- /dev/null +++ b/test/YAMLParser/invalid-single-quote-bug.test @@ -0,0 +1,4 @@ +# RUN: yaml-bench -canonical %s + +- "foo 'bar'" +- "foo\n'bar'" diff --git a/test/YAMLParser/merge.data b/test/YAMLParser/merge.data deleted file mode 100644 index 86313596e19..00000000000 --- a/test/YAMLParser/merge.data +++ /dev/null @@ -1,3 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- << diff --git a/test/YAMLParser/merge.test b/test/YAMLParser/merge.test new file mode 100644 index 00000000000..86313596e19 --- /dev/null +++ b/test/YAMLParser/merge.test @@ -0,0 +1,3 @@ +# RUN: yaml-bench -canonical %s + +- << diff --git a/test/YAMLParser/more-floats.data b/test/YAMLParser/more-floats.data deleted file mode 100644 index 668b31cd13a..00000000000 --- a/test/YAMLParser/more-floats.data +++ /dev/null @@ -1,3 +0,0 @@ -# RUN: yaml-bench -canonical %s - -[0.0, +1.0, -1.0, +.inf, -.inf, .nan, .nan] diff --git a/test/YAMLParser/more-floats.test b/test/YAMLParser/more-floats.test new file mode 100644 index 00000000000..668b31cd13a --- /dev/null +++ b/test/YAMLParser/more-floats.test @@ -0,0 +1,3 @@ +# RUN: yaml-bench -canonical %s + +[0.0, +1.0, -1.0, +.inf, -.inf, .nan, .nan] diff --git a/test/YAMLParser/negative-float-bug.data b/test/YAMLParser/negative-float-bug.data deleted file mode 100644 index 0ba0ffee301..00000000000 --- a/test/YAMLParser/negative-float-bug.data +++ /dev/null @@ -1,3 +0,0 @@ -# RUN: yaml-bench -canonical %s - --1.0 diff --git a/test/YAMLParser/negative-float-bug.test b/test/YAMLParser/negative-float-bug.test new file mode 100644 index 00000000000..0ba0ffee301 --- /dev/null +++ b/test/YAMLParser/negative-float-bug.test @@ -0,0 +1,3 @@ +# RUN: yaml-bench -canonical %s + +-1.0 diff --git a/test/YAMLParser/null.data b/test/YAMLParser/null.data deleted file mode 100644 index a38d7fa6c52..00000000000 --- a/test/YAMLParser/null.data +++ /dev/null @@ -1,5 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- -- ~ -- null diff --git a/test/YAMLParser/null.test b/test/YAMLParser/null.test new file mode 100644 index 00000000000..a38d7fa6c52 --- /dev/null +++ b/test/YAMLParser/null.test @@ -0,0 +1,5 @@ +# RUN: yaml-bench -canonical %s + +- +- ~ +- null diff --git a/test/YAMLParser/resolver.data b/test/YAMLParser/resolver.data deleted file mode 100644 index 8cbba6328b6..00000000000 --- a/test/YAMLParser/resolver.data +++ /dev/null @@ -1,32 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- -"this scalar should be selected" ---- -key11: !foo - key12: - is: [selected] - key22: - key13: [not, selected] - key23: [not, selected] - key32: - key31: [not, selected] - key32: [not, selected] - key33: {not: selected} -key21: !bar - - not selected - - selected - - not selected -key31: !baz - key12: - key13: - key14: {selected} - key23: - key14: [not, selected] - key33: - key14: {selected} - key24: {not: selected} - key22: - - key14: {selected} - key24: {not: selected} - - key14: {selected} diff --git a/test/YAMLParser/resolver.test b/test/YAMLParser/resolver.test new file mode 100644 index 00000000000..8cbba6328b6 --- /dev/null +++ b/test/YAMLParser/resolver.test @@ -0,0 +1,32 @@ +# RUN: yaml-bench -canonical %s + +--- +"this scalar should be selected" +--- +key11: !foo + key12: + is: [selected] + key22: + key13: [not, selected] + key23: [not, selected] + key32: + key31: [not, selected] + key32: [not, selected] + key33: {not: selected} +key21: !bar + - not selected + - selected + - not selected +key31: !baz + key12: + key13: + key14: {selected} + key23: + key14: [not, selected] + key33: + key14: {selected} + key24: {not: selected} + key22: + - key14: {selected} + key24: {not: selected} + - key14: {selected} diff --git a/test/YAMLParser/run-parser-crash-bug.data b/test/YAMLParser/run-parser-crash-bug.data deleted file mode 100644 index 3ec910ce047..00000000000 --- a/test/YAMLParser/run-parser-crash-bug.data +++ /dev/null @@ -1,10 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- -- Harry Potter and the Prisoner of Azkaban -- Harry Potter and the Goblet of Fire -- Harry Potter and the Order of the Phoenix ---- -- Memoirs Found in a Bathtub -- Snow Crash -- Ghost World diff --git a/test/YAMLParser/run-parser-crash-bug.test b/test/YAMLParser/run-parser-crash-bug.test new file mode 100644 index 00000000000..3ec910ce047 --- /dev/null +++ b/test/YAMLParser/run-parser-crash-bug.test @@ -0,0 +1,10 @@ +# RUN: yaml-bench -canonical %s + +--- +- Harry Potter and the Prisoner of Azkaban +- Harry Potter and the Goblet of Fire +- Harry Potter and the Order of the Phoenix +--- +- Memoirs Found in a Bathtub +- Snow Crash +- Ghost World diff --git a/test/YAMLParser/scan-document-end-bug.data b/test/YAMLParser/scan-document-end-bug.data deleted file mode 100644 index 7354caf8cd8..00000000000 --- a/test/YAMLParser/scan-document-end-bug.data +++ /dev/null @@ -1,5 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# Ticket #4 ---- -... diff --git a/test/YAMLParser/scan-document-end-bug.test b/test/YAMLParser/scan-document-end-bug.test new file mode 100644 index 00000000000..7354caf8cd8 --- /dev/null +++ b/test/YAMLParser/scan-document-end-bug.test @@ -0,0 +1,5 @@ +# RUN: yaml-bench -canonical %s + +# Ticket #4 +--- +... diff --git a/test/YAMLParser/scan-line-break-bug.data b/test/YAMLParser/scan-line-break-bug.data deleted file mode 100644 index 792973d3f56..00000000000 --- a/test/YAMLParser/scan-line-break-bug.data +++ /dev/null @@ -1,5 +0,0 @@ -# RUN: yaml-bench -canonical %s - -foo: - bar - baz diff --git a/test/YAMLParser/scan-line-break-bug.test b/test/YAMLParser/scan-line-break-bug.test new file mode 100644 index 00000000000..792973d3f56 --- /dev/null +++ b/test/YAMLParser/scan-line-break-bug.test @@ -0,0 +1,5 @@ +# RUN: yaml-bench -canonical %s + +foo: + bar + baz diff --git a/test/YAMLParser/single-dot-is-not-float-bug.data b/test/YAMLParser/single-dot-is-not-float-bug.data deleted file mode 100644 index 810a5936a89..00000000000 --- a/test/YAMLParser/single-dot-is-not-float-bug.data +++ /dev/null @@ -1,3 +0,0 @@ -# RUN: yaml-bench -canonical %s - -. diff --git a/test/YAMLParser/single-dot-is-not-float-bug.test b/test/YAMLParser/single-dot-is-not-float-bug.test new file mode 100644 index 00000000000..810a5936a89 --- /dev/null +++ b/test/YAMLParser/single-dot-is-not-float-bug.test @@ -0,0 +1,3 @@ +# RUN: yaml-bench -canonical %s + +. diff --git a/test/YAMLParser/sloppy-indentation.data b/test/YAMLParser/sloppy-indentation.data deleted file mode 100644 index 2b2b62b14af..00000000000 --- a/test/YAMLParser/sloppy-indentation.data +++ /dev/null @@ -1,19 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- -in the block context: - indentation should be kept: { - but in the flow context: [ -it may be violated] -} ---- -the parser does not require scalars -to be indented with at least one space -... ---- -"the parser does not require scalars -to be indented with at least one space" ---- -foo: - bar: 'quoted scalars -may not adhere indentation' diff --git a/test/YAMLParser/sloppy-indentation.test b/test/YAMLParser/sloppy-indentation.test new file mode 100644 index 00000000000..2b2b62b14af --- /dev/null +++ b/test/YAMLParser/sloppy-indentation.test @@ -0,0 +1,19 @@ +# RUN: yaml-bench -canonical %s + +--- +in the block context: + indentation should be kept: { + but in the flow context: [ +it may be violated] +} +--- +the parser does not require scalars +to be indented with at least one space +... +--- +"the parser does not require scalars +to be indented with at least one space" +--- +foo: + bar: 'quoted scalars +may not adhere indentation' diff --git a/test/YAMLParser/spec-02-01.data b/test/YAMLParser/spec-02-01.data deleted file mode 100644 index dd15b2bc26a..00000000000 --- a/test/YAMLParser/spec-02-01.data +++ /dev/null @@ -1,5 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- Mark McGwire -- Sammy Sosa -- Ken Griffey diff --git a/test/YAMLParser/spec-02-01.test b/test/YAMLParser/spec-02-01.test new file mode 100644 index 00000000000..dd15b2bc26a --- /dev/null +++ b/test/YAMLParser/spec-02-01.test @@ -0,0 +1,5 @@ +# RUN: yaml-bench -canonical %s + +- Mark McGwire +- Sammy Sosa +- Ken Griffey diff --git a/test/YAMLParser/spec-02-02.data b/test/YAMLParser/spec-02-02.data deleted file mode 100644 index a5695d5c27a..00000000000 --- a/test/YAMLParser/spec-02-02.data +++ /dev/null @@ -1,5 +0,0 @@ -# RUN: yaml-bench -canonical %s - -hr: 65 # Home runs -avg: 0.278 # Batting average -rbi: 147 # Runs Batted In diff --git a/test/YAMLParser/spec-02-02.test b/test/YAMLParser/spec-02-02.test new file mode 100644 index 00000000000..a5695d5c27a --- /dev/null +++ b/test/YAMLParser/spec-02-02.test @@ -0,0 +1,5 @@ +# RUN: yaml-bench -canonical %s + +hr: 65 # Home runs +avg: 0.278 # Batting average +rbi: 147 # Runs Batted In diff --git a/test/YAMLParser/spec-02-03.data b/test/YAMLParser/spec-02-03.data deleted file mode 100644 index 81f8d991f74..00000000000 --- a/test/YAMLParser/spec-02-03.data +++ /dev/null @@ -1,10 +0,0 @@ -# RUN: yaml-bench -canonical %s - -american: - - Boston Red Sox - - Detroit Tigers - - New York Yankees -national: - - New York Mets - - Chicago Cubs - - Atlanta Braves diff --git a/test/YAMLParser/spec-02-03.test b/test/YAMLParser/spec-02-03.test new file mode 100644 index 00000000000..81f8d991f74 --- /dev/null +++ b/test/YAMLParser/spec-02-03.test @@ -0,0 +1,10 @@ +# RUN: yaml-bench -canonical %s + +american: + - Boston Red Sox + - Detroit Tigers + - New York Yankees +national: + - New York Mets + - Chicago Cubs + - Atlanta Braves diff --git a/test/YAMLParser/spec-02-04.data b/test/YAMLParser/spec-02-04.data deleted file mode 100644 index 44a218d5926..00000000000 --- a/test/YAMLParser/spec-02-04.data +++ /dev/null @@ -1,10 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- - name: Mark McGwire - hr: 65 - avg: 0.278 -- - name: Sammy Sosa - hr: 63 - avg: 0.288 diff --git a/test/YAMLParser/spec-02-04.test b/test/YAMLParser/spec-02-04.test new file mode 100644 index 00000000000..44a218d5926 --- /dev/null +++ b/test/YAMLParser/spec-02-04.test @@ -0,0 +1,10 @@ +# RUN: yaml-bench -canonical %s + +- + name: Mark McGwire + hr: 65 + avg: 0.278 +- + name: Sammy Sosa + hr: 63 + avg: 0.288 diff --git a/test/YAMLParser/spec-02-05.data b/test/YAMLParser/spec-02-05.data deleted file mode 100644 index c9a4a7572f7..00000000000 --- a/test/YAMLParser/spec-02-05.data +++ /dev/null @@ -1,5 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- [name , hr, avg ] -- [Mark McGwire, 65, 0.278] -- [Sammy Sosa , 63, 0.288] diff --git a/test/YAMLParser/spec-02-05.test b/test/YAMLParser/spec-02-05.test new file mode 100644 index 00000000000..c9a4a7572f7 --- /dev/null +++ b/test/YAMLParser/spec-02-05.test @@ -0,0 +1,5 @@ +# RUN: yaml-bench -canonical %s + +- [name , hr, avg ] +- [Mark McGwire, 65, 0.278] +- [Sammy Sosa , 63, 0.288] diff --git a/test/YAMLParser/spec-02-06.data b/test/YAMLParser/spec-02-06.data deleted file mode 100644 index 85c1e2bab8c..00000000000 --- a/test/YAMLParser/spec-02-06.data +++ /dev/null @@ -1,7 +0,0 @@ -# RUN: yaml-bench -canonical %s - -Mark McGwire: {hr: 65, avg: 0.278} -Sammy Sosa: { - hr: 63, - avg: 0.288 - } diff --git a/test/YAMLParser/spec-02-06.test b/test/YAMLParser/spec-02-06.test new file mode 100644 index 00000000000..85c1e2bab8c --- /dev/null +++ b/test/YAMLParser/spec-02-06.test @@ -0,0 +1,7 @@ +# RUN: yaml-bench -canonical %s + +Mark McGwire: {hr: 65, avg: 0.278} +Sammy Sosa: { + hr: 63, + avg: 0.288 + } diff --git a/test/YAMLParser/spec-02-07.data b/test/YAMLParser/spec-02-07.data deleted file mode 100644 index c349662a98a..00000000000 --- a/test/YAMLParser/spec-02-07.data +++ /dev/null @@ -1,12 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# Ranking of 1998 home runs ---- -- Mark McGwire -- Sammy Sosa -- Ken Griffey - -# Team ranking ---- -- Chicago Cubs -- St Louis Cardinals diff --git a/test/YAMLParser/spec-02-07.test b/test/YAMLParser/spec-02-07.test new file mode 100644 index 00000000000..c349662a98a --- /dev/null +++ b/test/YAMLParser/spec-02-07.test @@ -0,0 +1,12 @@ +# RUN: yaml-bench -canonical %s + +# Ranking of 1998 home runs +--- +- Mark McGwire +- Sammy Sosa +- Ken Griffey + +# Team ranking +--- +- Chicago Cubs +- St Louis Cardinals diff --git a/test/YAMLParser/spec-02-08.data b/test/YAMLParser/spec-02-08.data deleted file mode 100644 index 9746a43788a..00000000000 --- a/test/YAMLParser/spec-02-08.data +++ /dev/null @@ -1,12 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- -time: 20:03:20 -player: Sammy Sosa -action: strike (miss) -... ---- -time: 20:03:47 -player: Sammy Sosa -action: grand slam -... diff --git a/test/YAMLParser/spec-02-08.test b/test/YAMLParser/spec-02-08.test new file mode 100644 index 00000000000..9746a43788a --- /dev/null +++ b/test/YAMLParser/spec-02-08.test @@ -0,0 +1,12 @@ +# RUN: yaml-bench -canonical %s + +--- +time: 20:03:20 +player: Sammy Sosa +action: strike (miss) +... +--- +time: 20:03:47 +player: Sammy Sosa +action: grand slam +... diff --git a/test/YAMLParser/spec-02-09.data b/test/YAMLParser/spec-02-09.data deleted file mode 100644 index 6aef9333799..00000000000 --- a/test/YAMLParser/spec-02-09.data +++ /dev/null @@ -1,10 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- -hr: # 1998 hr ranking - - Mark McGwire - - Sammy Sosa -rbi: - # 1998 rbi ranking - - Sammy Sosa - - Ken Griffey diff --git a/test/YAMLParser/spec-02-09.test b/test/YAMLParser/spec-02-09.test new file mode 100644 index 00000000000..6aef9333799 --- /dev/null +++ b/test/YAMLParser/spec-02-09.test @@ -0,0 +1,10 @@ +# RUN: yaml-bench -canonical %s + +--- +hr: # 1998 hr ranking + - Mark McGwire + - Sammy Sosa +rbi: + # 1998 rbi ranking + - Sammy Sosa + - Ken Griffey diff --git a/test/YAMLParser/spec-02-10.data b/test/YAMLParser/spec-02-10.data deleted file mode 100644 index 0302fa75009..00000000000 --- a/test/YAMLParser/spec-02-10.data +++ /dev/null @@ -1,10 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- -hr: - - Mark McGwire - # Following node labeled SS - - &SS Sammy Sosa -rbi: - - *SS # Subsequent occurrence - - Ken Griffey diff --git a/test/YAMLParser/spec-02-10.test b/test/YAMLParser/spec-02-10.test new file mode 100644 index 00000000000..0302fa75009 --- /dev/null +++ b/test/YAMLParser/spec-02-10.test @@ -0,0 +1,10 @@ +# RUN: yaml-bench -canonical %s + +--- +hr: + - Mark McGwire + # Following node labeled SS + - &SS Sammy Sosa +rbi: + - *SS # Subsequent occurrence + - Ken Griffey diff --git a/test/YAMLParser/spec-02-11.data b/test/YAMLParser/spec-02-11.data deleted file mode 100644 index d8cf863b2c1..00000000000 --- a/test/YAMLParser/spec-02-11.data +++ /dev/null @@ -1,11 +0,0 @@ -# RUN: yaml-bench -canonical %s - -? - Detroit Tigers - - Chicago cubs -: - - 2001-07-23 - -? [ New York Yankees, - Atlanta Braves ] -: [ 2001-07-02, 2001-08-12, - 2001-08-14 ] diff --git a/test/YAMLParser/spec-02-11.test b/test/YAMLParser/spec-02-11.test new file mode 100644 index 00000000000..d8cf863b2c1 --- /dev/null +++ b/test/YAMLParser/spec-02-11.test @@ -0,0 +1,11 @@ +# RUN: yaml-bench -canonical %s + +? - Detroit Tigers + - Chicago cubs +: + - 2001-07-23 + +? [ New York Yankees, + Atlanta Braves ] +: [ 2001-07-02, 2001-08-12, + 2001-08-14 ] diff --git a/test/YAMLParser/spec-02-12.data b/test/YAMLParser/spec-02-12.data deleted file mode 100644 index 3b4d5370a93..00000000000 --- a/test/YAMLParser/spec-02-12.data +++ /dev/null @@ -1,10 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- -# products purchased -- item : Super Hoop - quantity: 1 -- item : Basketball - quantity: 4 -- item : Big Shoes - quantity: 1 diff --git a/test/YAMLParser/spec-02-12.test b/test/YAMLParser/spec-02-12.test new file mode 100644 index 00000000000..3b4d5370a93 --- /dev/null +++ b/test/YAMLParser/spec-02-12.test @@ -0,0 +1,10 @@ +# RUN: yaml-bench -canonical %s + +--- +# products purchased +- item : Super Hoop + quantity: 1 +- item : Basketball + quantity: 4 +- item : Big Shoes + quantity: 1 diff --git a/test/YAMLParser/spec-02-13.data b/test/YAMLParser/spec-02-13.data deleted file mode 100644 index 2bbccbf5d7d..00000000000 --- a/test/YAMLParser/spec-02-13.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# ASCII Art ---- | - \//||\/|| - // || ||__ diff --git a/test/YAMLParser/spec-02-13.test b/test/YAMLParser/spec-02-13.test new file mode 100644 index 00000000000..2bbccbf5d7d --- /dev/null +++ b/test/YAMLParser/spec-02-13.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +# ASCII Art +--- | + \//||\/|| + // || ||__ diff --git a/test/YAMLParser/spec-02-14.data b/test/YAMLParser/spec-02-14.data deleted file mode 100644 index 5a18ea213e6..00000000000 --- a/test/YAMLParser/spec-02-14.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- - Mark McGwire's - year was crippled - by a knee injury. diff --git a/test/YAMLParser/spec-02-14.test b/test/YAMLParser/spec-02-14.test new file mode 100644 index 00000000000..5a18ea213e6 --- /dev/null +++ b/test/YAMLParser/spec-02-14.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +--- + Mark McGwire's + year was crippled + by a knee injury. diff --git a/test/YAMLParser/spec-02-15.data b/test/YAMLParser/spec-02-15.data deleted file mode 100644 index 2a7fbe96ad4..00000000000 --- a/test/YAMLParser/spec-02-15.data +++ /dev/null @@ -1,10 +0,0 @@ -# RUN: yaml-bench -canonical %s - -> - Sammy Sosa completed another - fine season with great stats. - - 63 Home Runs - 0.288 Batting Average - - What a year! diff --git a/test/YAMLParser/spec-02-15.test b/test/YAMLParser/spec-02-15.test new file mode 100644 index 00000000000..2a7fbe96ad4 --- /dev/null +++ b/test/YAMLParser/spec-02-15.test @@ -0,0 +1,10 @@ +# RUN: yaml-bench -canonical %s + +> + Sammy Sosa completed another + fine season with great stats. + + 63 Home Runs + 0.288 Batting Average + + What a year! diff --git a/test/YAMLParser/spec-02-16.data b/test/YAMLParser/spec-02-16.data deleted file mode 100644 index 3a5792c7632..00000000000 --- a/test/YAMLParser/spec-02-16.data +++ /dev/null @@ -1,9 +0,0 @@ -# RUN: yaml-bench -canonical %s - -name: Mark McGwire -accomplishment: > - Mark set a major league - home run record in 1998. -stats: | - 65 Home Runs - 0.278 Batting Average diff --git a/test/YAMLParser/spec-02-16.test b/test/YAMLParser/spec-02-16.test new file mode 100644 index 00000000000..3a5792c7632 --- /dev/null +++ b/test/YAMLParser/spec-02-16.test @@ -0,0 +1,9 @@ +# RUN: yaml-bench -canonical %s + +name: Mark McGwire +accomplishment: > + Mark set a major league + home run record in 1998. +stats: | + 65 Home Runs + 0.278 Batting Average diff --git a/test/YAMLParser/spec-02-17.data b/test/YAMLParser/spec-02-17.data deleted file mode 100644 index 2bcb60c8d93..00000000000 --- a/test/YAMLParser/spec-02-17.data +++ /dev/null @@ -1,16 +0,0 @@ -# RUN: yaml-bench -canonical %s - -unicode: "Sosa did fine.\u263A" -control: "\b1998\t1999\t2000\n" -hexesc: "\x13\x10 is \r\n" - -single: '"Howdy!" he cried.' -quoted: ' # not a ''comment''.' -tie-fighter: '|\-*-/|' - -# CHECK: !!str "Sosa did fine.\u263A" -# CHECK: !!str "\b1998\t1999\t2000\n" -# CHECK: !!str "\x13\x10 is \r\n" -# CHECK: !!str "\"Howdy!\" he cried." -# CHECK: !!str " # not a 'comment'." -# CHECK: !!str "|\\-*-/|" diff --git a/test/YAMLParser/spec-02-17.test b/test/YAMLParser/spec-02-17.test new file mode 100644 index 00000000000..2bcb60c8d93 --- /dev/null +++ b/test/YAMLParser/spec-02-17.test @@ -0,0 +1,16 @@ +# RUN: yaml-bench -canonical %s + +unicode: "Sosa did fine.\u263A" +control: "\b1998\t1999\t2000\n" +hexesc: "\x13\x10 is \r\n" + +single: '"Howdy!" he cried.' +quoted: ' # not a ''comment''.' +tie-fighter: '|\-*-/|' + +# CHECK: !!str "Sosa did fine.\u263A" +# CHECK: !!str "\b1998\t1999\t2000\n" +# CHECK: !!str "\x13\x10 is \r\n" +# CHECK: !!str "\"Howdy!\" he cried." +# CHECK: !!str " # not a 'comment'." +# CHECK: !!str "|\\-*-/|" diff --git a/test/YAMLParser/spec-02-18.data b/test/YAMLParser/spec-02-18.data deleted file mode 100644 index 625a4962e99..00000000000 --- a/test/YAMLParser/spec-02-18.data +++ /dev/null @@ -1,8 +0,0 @@ -# RUN: yaml-bench -canonical %s - -plain: - This unquoted scalar - spans many lines. - -quoted: "So does this - quoted scalar.\n" diff --git a/test/YAMLParser/spec-02-18.test b/test/YAMLParser/spec-02-18.test new file mode 100644 index 00000000000..625a4962e99 --- /dev/null +++ b/test/YAMLParser/spec-02-18.test @@ -0,0 +1,8 @@ +# RUN: yaml-bench -canonical %s + +plain: + This unquoted scalar + spans many lines. + +quoted: "So does this + quoted scalar.\n" diff --git a/test/YAMLParser/spec-02-19.data b/test/YAMLParser/spec-02-19.data deleted file mode 100644 index cb9df6dd1f4..00000000000 --- a/test/YAMLParser/spec-02-19.data +++ /dev/null @@ -1,7 +0,0 @@ -# RUN: yaml-bench -canonical %s - -canonical: 12345 -decimal: +12,345 -sexagesimal: 3:25:45 -octal: 014 -hexadecimal: 0xC diff --git a/test/YAMLParser/spec-02-19.test b/test/YAMLParser/spec-02-19.test new file mode 100644 index 00000000000..cb9df6dd1f4 --- /dev/null +++ b/test/YAMLParser/spec-02-19.test @@ -0,0 +1,7 @@ +# RUN: yaml-bench -canonical %s + +canonical: 12345 +decimal: +12,345 +sexagesimal: 3:25:45 +octal: 014 +hexadecimal: 0xC diff --git a/test/YAMLParser/spec-02-20.data b/test/YAMLParser/spec-02-20.data deleted file mode 100644 index ed147986119..00000000000 --- a/test/YAMLParser/spec-02-20.data +++ /dev/null @@ -1,8 +0,0 @@ -# RUN: yaml-bench -canonical %s - -canonical: 1.23015e+3 -exponential: 12.3015e+02 -sexagesimal: 20:30.15 -fixed: 1,230.15 -negative infinity: -.inf -not a number: .NaN diff --git a/test/YAMLParser/spec-02-20.test b/test/YAMLParser/spec-02-20.test new file mode 100644 index 00000000000..ed147986119 --- /dev/null +++ b/test/YAMLParser/spec-02-20.test @@ -0,0 +1,8 @@ +# RUN: yaml-bench -canonical %s + +canonical: 1.23015e+3 +exponential: 12.3015e+02 +sexagesimal: 20:30.15 +fixed: 1,230.15 +negative infinity: -.inf +not a number: .NaN diff --git a/test/YAMLParser/spec-02-21.data b/test/YAMLParser/spec-02-21.data deleted file mode 100644 index ea979db065b..00000000000 --- a/test/YAMLParser/spec-02-21.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - -null: ~ -true: y -false: n -string: '12345' diff --git a/test/YAMLParser/spec-02-21.test b/test/YAMLParser/spec-02-21.test new file mode 100644 index 00000000000..ea979db065b --- /dev/null +++ b/test/YAMLParser/spec-02-21.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +null: ~ +true: y +false: n +string: '12345' diff --git a/test/YAMLParser/spec-02-22.data b/test/YAMLParser/spec-02-22.data deleted file mode 100644 index 77724f71066..00000000000 --- a/test/YAMLParser/spec-02-22.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - -canonical: 2001-12-15T02:59:43.1Z -iso8601: 2001-12-14t21:59:43.10-05:00 -spaced: 2001-12-14 21:59:43.10 -5 -date: 2002-12-14 diff --git a/test/YAMLParser/spec-02-22.test b/test/YAMLParser/spec-02-22.test new file mode 100644 index 00000000000..77724f71066 --- /dev/null +++ b/test/YAMLParser/spec-02-22.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +canonical: 2001-12-15T02:59:43.1Z +iso8601: 2001-12-14t21:59:43.10-05:00 +spaced: 2001-12-14 21:59:43.10 -5 +date: 2002-12-14 diff --git a/test/YAMLParser/spec-02-23.data b/test/YAMLParser/spec-02-23.data deleted file mode 100644 index d08dfa755c6..00000000000 --- a/test/YAMLParser/spec-02-23.data +++ /dev/null @@ -1,15 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- -not-date: !!str 2002-04-28 - -picture: !!binary | - R0lGODlhDAAMAIQAAP//9/X - 17unp5WZmZgAAAOfn515eXv - Pz7Y6OjuDg4J+fn5OTk6enp - 56enmleECcgggoBADs= - -application specific tag: !something | - The semantics of the tag - above may be different for - different documents. diff --git a/test/YAMLParser/spec-02-23.test b/test/YAMLParser/spec-02-23.test new file mode 100644 index 00000000000..d08dfa755c6 --- /dev/null +++ b/test/YAMLParser/spec-02-23.test @@ -0,0 +1,15 @@ +# RUN: yaml-bench -canonical %s + +--- +not-date: !!str 2002-04-28 + +picture: !!binary | + R0lGODlhDAAMAIQAAP//9/X + 17unp5WZmZgAAAOfn515eXv + Pz7Y6OjuDg4J+fn5OTk6enp + 56enmleECcgggoBADs= + +application specific tag: !something | + The semantics of the tag + above may be different for + different documents. diff --git a/test/YAMLParser/spec-02-24.data b/test/YAMLParser/spec-02-24.data deleted file mode 100644 index 56b25cbbd80..00000000000 --- a/test/YAMLParser/spec-02-24.data +++ /dev/null @@ -1,21 +0,0 @@ -# RUN: yaml-bench -canonical %s | FileCheck %s - -%TAG ! tag:clarkevans.com,2002: ---- !shape - # Use the ! handle for presenting - # tag:clarkevans.com,2002:circle -- !circle - center: &ORIGIN {x: 73, y: 129} - radius: 7 -- !line - start: *ORIGIN - finish: { x: 89, y: 102 } -- !label - start: *ORIGIN - color: 0xFFEEBB - text: Pretty vector drawing. - -#CHECK: ! -#CHECK: ! -#CHECK: ! -#CHECK: ! diff --git a/test/YAMLParser/spec-02-24.test b/test/YAMLParser/spec-02-24.test new file mode 100644 index 00000000000..56b25cbbd80 --- /dev/null +++ b/test/YAMLParser/spec-02-24.test @@ -0,0 +1,21 @@ +# RUN: yaml-bench -canonical %s | FileCheck %s + +%TAG ! tag:clarkevans.com,2002: +--- !shape + # Use the ! handle for presenting + # tag:clarkevans.com,2002:circle +- !circle + center: &ORIGIN {x: 73, y: 129} + radius: 7 +- !line + start: *ORIGIN + finish: { x: 89, y: 102 } +- !label + start: *ORIGIN + color: 0xFFEEBB + text: Pretty vector drawing. + +#CHECK: ! +#CHECK: ! +#CHECK: ! +#CHECK: ! diff --git a/test/YAMLParser/spec-02-25.data b/test/YAMLParser/spec-02-25.data deleted file mode 100644 index fbadfda97e3..00000000000 --- a/test/YAMLParser/spec-02-25.data +++ /dev/null @@ -1,9 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# sets are represented as a -# mapping where each key is -# associated with the empty string ---- !!set -? Mark McGwire -? Sammy Sosa -? Ken Griff diff --git a/test/YAMLParser/spec-02-25.test b/test/YAMLParser/spec-02-25.test new file mode 100644 index 00000000000..fbadfda97e3 --- /dev/null +++ b/test/YAMLParser/spec-02-25.test @@ -0,0 +1,9 @@ +# RUN: yaml-bench -canonical %s + +# sets are represented as a +# mapping where each key is +# associated with the empty string +--- !!set +? Mark McGwire +? Sammy Sosa +? Ken Griff diff --git a/test/YAMLParser/spec-02-26.data b/test/YAMLParser/spec-02-26.data deleted file mode 100644 index 257108e7e04..00000000000 --- a/test/YAMLParser/spec-02-26.data +++ /dev/null @@ -1,9 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# ordered maps are represented as -# a sequence of mappings, with -# each mapping having one key ---- !!omap -- Mark McGwire: 65 -- Sammy Sosa: 63 -- Ken Griffy: 58 diff --git a/test/YAMLParser/spec-02-26.test b/test/YAMLParser/spec-02-26.test new file mode 100644 index 00000000000..257108e7e04 --- /dev/null +++ b/test/YAMLParser/spec-02-26.test @@ -0,0 +1,9 @@ +# RUN: yaml-bench -canonical %s + +# ordered maps are represented as +# a sequence of mappings, with +# each mapping having one key +--- !!omap +- Mark McGwire: 65 +- Sammy Sosa: 63 +- Ken Griffy: 58 diff --git a/test/YAMLParser/spec-02-27.data b/test/YAMLParser/spec-02-27.data deleted file mode 100644 index a190ff19db0..00000000000 --- a/test/YAMLParser/spec-02-27.data +++ /dev/null @@ -1,31 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- ! -invoice: 34843 -date : 2001-01-23 -bill-to: &id001 - given : Chris - family : Dumars - address: - lines: | - 458 Walkman Dr. - Suite #292 - city : Royal Oak - state : MI - postal : 48046 -ship-to: *id001 -product: - - sku : BL394D - quantity : 4 - description : Basketball - price : 450.00 - - sku : BL4438H - quantity : 1 - description : Super Hoop - price : 2392.00 -tax : 251.42 -total: 4443.52 -comments: - Late afternoon is best. - Backup contact is Nancy - Billsmer @ 338-4338. diff --git a/test/YAMLParser/spec-02-27.test b/test/YAMLParser/spec-02-27.test new file mode 100644 index 00000000000..a190ff19db0 --- /dev/null +++ b/test/YAMLParser/spec-02-27.test @@ -0,0 +1,31 @@ +# RUN: yaml-bench -canonical %s + +--- ! +invoice: 34843 +date : 2001-01-23 +bill-to: &id001 + given : Chris + family : Dumars + address: + lines: | + 458 Walkman Dr. + Suite #292 + city : Royal Oak + state : MI + postal : 48046 +ship-to: *id001 +product: + - sku : BL394D + quantity : 4 + description : Basketball + price : 450.00 + - sku : BL4438H + quantity : 1 + description : Super Hoop + price : 2392.00 +tax : 251.42 +total: 4443.52 +comments: + Late afternoon is best. + Backup contact is Nancy + Billsmer @ 338-4338. diff --git a/test/YAMLParser/spec-02-28.data b/test/YAMLParser/spec-02-28.data deleted file mode 100644 index 695c27f5d55..00000000000 --- a/test/YAMLParser/spec-02-28.data +++ /dev/null @@ -1,28 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- -Time: 2001-11-23 15:01:42 -5 -User: ed -Warning: - This is an error message - for the log file ---- -Time: 2001-11-23 15:02:31 -5 -User: ed -Warning: - A slightly different error - message. ---- -Date: 2001-11-23 15:03:17 -5 -User: ed -Fatal: - Unknown variable "bar" -Stack: - - file: TopClass.py - line: 23 - code: | - x = MoreObject("345\n") - - file: MoreClass.py - line: 58 - code: |- - foo = bar diff --git a/test/YAMLParser/spec-02-28.test b/test/YAMLParser/spec-02-28.test new file mode 100644 index 00000000000..695c27f5d55 --- /dev/null +++ b/test/YAMLParser/spec-02-28.test @@ -0,0 +1,28 @@ +# RUN: yaml-bench -canonical %s + +--- +Time: 2001-11-23 15:01:42 -5 +User: ed +Warning: + This is an error message + for the log file +--- +Time: 2001-11-23 15:02:31 -5 +User: ed +Warning: + A slightly different error + message. +--- +Date: 2001-11-23 15:03:17 -5 +User: ed +Fatal: + Unknown variable "bar" +Stack: + - file: TopClass.py + line: 23 + code: | + x = MoreObject("345\n") + - file: MoreClass.py + line: 58 + code: |- + foo = bar diff --git a/test/YAMLParser/spec-05-01-utf8.data b/test/YAMLParser/spec-05-01-utf8.data deleted file mode 100644 index 349da06fab2..00000000000 --- a/test/YAMLParser/spec-05-01-utf8.data +++ /dev/null @@ -1,3 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# Comment only. diff --git a/test/YAMLParser/spec-05-01-utf8.test b/test/YAMLParser/spec-05-01-utf8.test new file mode 100644 index 00000000000..349da06fab2 --- /dev/null +++ b/test/YAMLParser/spec-05-01-utf8.test @@ -0,0 +1,3 @@ +# RUN: yaml-bench -canonical %s + +# Comment only. diff --git a/test/YAMLParser/spec-05-02-utf8.data b/test/YAMLParser/spec-05-02-utf8.data deleted file mode 100644 index 028f41bb557..00000000000 --- a/test/YAMLParser/spec-05-02-utf8.data +++ /dev/null @@ -1,7 +0,0 @@ -# RUN: yaml-bench -canonical %s 2>&1 | FileCheck %s - -# Invalid use of BOM -# inside a -# document. - -# CHECK: error diff --git a/test/YAMLParser/spec-05-02-utf8.test b/test/YAMLParser/spec-05-02-utf8.test new file mode 100644 index 00000000000..3666f990e47 --- /dev/null +++ b/test/YAMLParser/spec-05-02-utf8.test @@ -0,0 +1,7 @@ +# RUN: not yaml-bench -canonical %s 2>&1 | FileCheck %s + +# Invalid use of BOM +# inside a +# document. + +# CHECK: error diff --git a/test/YAMLParser/spec-05-03.data b/test/YAMLParser/spec-05-03.data deleted file mode 100644 index 461e98d2c2b..00000000000 --- a/test/YAMLParser/spec-05-03.data +++ /dev/null @@ -1,9 +0,0 @@ -# RUN: yaml-bench -canonical %s - -sequence: -- one -- two -mapping: - ? sky - : blue - ? sea : green diff --git a/test/YAMLParser/spec-05-03.test b/test/YAMLParser/spec-05-03.test new file mode 100644 index 00000000000..461e98d2c2b --- /dev/null +++ b/test/YAMLParser/spec-05-03.test @@ -0,0 +1,9 @@ +# RUN: yaml-bench -canonical %s + +sequence: +- one +- two +mapping: + ? sky + : blue + ? sea : green diff --git a/test/YAMLParser/spec-05-04.data b/test/YAMLParser/spec-05-04.data deleted file mode 100644 index 52850f435bf..00000000000 --- a/test/YAMLParser/spec-05-04.data +++ /dev/null @@ -1,4 +0,0 @@ -# RUN: yaml-bench -canonical %s - -sequence: [ one, two, ] -mapping: { sky: blue, sea: green } diff --git a/test/YAMLParser/spec-05-04.test b/test/YAMLParser/spec-05-04.test new file mode 100644 index 00000000000..52850f435bf --- /dev/null +++ b/test/YAMLParser/spec-05-04.test @@ -0,0 +1,4 @@ +# RUN: yaml-bench -canonical %s + +sequence: [ one, two, ] +mapping: { sky: blue, sea: green } diff --git a/test/YAMLParser/spec-05-05.data b/test/YAMLParser/spec-05-05.data deleted file mode 100644 index 499ee8ffb8f..00000000000 --- a/test/YAMLParser/spec-05-05.data +++ /dev/null @@ -1,3 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# Comment only. diff --git a/test/YAMLParser/spec-05-05.test b/test/YAMLParser/spec-05-05.test new file mode 100644 index 00000000000..499ee8ffb8f --- /dev/null +++ b/test/YAMLParser/spec-05-05.test @@ -0,0 +1,3 @@ +# RUN: yaml-bench -canonical %s + +# Comment only. diff --git a/test/YAMLParser/spec-05-06.data b/test/YAMLParser/spec-05-06.data deleted file mode 100644 index 729141acf4b..00000000000 --- a/test/YAMLParser/spec-05-06.data +++ /dev/null @@ -1,4 +0,0 @@ -# RUN: yaml-bench -canonical %s - -anchored: !local &anchor value -alias: *anchor diff --git a/test/YAMLParser/spec-05-06.test b/test/YAMLParser/spec-05-06.test new file mode 100644 index 00000000000..729141acf4b --- /dev/null +++ b/test/YAMLParser/spec-05-06.test @@ -0,0 +1,4 @@ +# RUN: yaml-bench -canonical %s + +anchored: !local &anchor value +alias: *anchor diff --git a/test/YAMLParser/spec-05-07.data b/test/YAMLParser/spec-05-07.data deleted file mode 100644 index fc80a0d4152..00000000000 --- a/test/YAMLParser/spec-05-07.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - -literal: | - text -folded: > - text diff --git a/test/YAMLParser/spec-05-07.test b/test/YAMLParser/spec-05-07.test new file mode 100644 index 00000000000..fc80a0d4152 --- /dev/null +++ b/test/YAMLParser/spec-05-07.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +literal: | + text +folded: > + text diff --git a/test/YAMLParser/spec-05-08.data b/test/YAMLParser/spec-05-08.data deleted file mode 100644 index 9f2b7ece53f..00000000000 --- a/test/YAMLParser/spec-05-08.data +++ /dev/null @@ -1,4 +0,0 @@ -# RUN: yaml-bench -canonical %s - -single: 'text' -double: "text" diff --git a/test/YAMLParser/spec-05-08.test b/test/YAMLParser/spec-05-08.test new file mode 100644 index 00000000000..9f2b7ece53f --- /dev/null +++ b/test/YAMLParser/spec-05-08.test @@ -0,0 +1,4 @@ +# RUN: yaml-bench -canonical %s + +single: 'text' +double: "text" diff --git a/test/YAMLParser/spec-05-09.data b/test/YAMLParser/spec-05-09.data deleted file mode 100644 index fc061fb2982..00000000000 --- a/test/YAMLParser/spec-05-09.data +++ /dev/null @@ -1,4 +0,0 @@ -# RUN: yaml-bench -canonical %s - -%YAML 1.1 ---- text diff --git a/test/YAMLParser/spec-05-09.test b/test/YAMLParser/spec-05-09.test new file mode 100644 index 00000000000..fc061fb2982 --- /dev/null +++ b/test/YAMLParser/spec-05-09.test @@ -0,0 +1,4 @@ +# RUN: yaml-bench -canonical %s + +%YAML 1.1 +--- text diff --git a/test/YAMLParser/spec-05-10.data b/test/YAMLParser/spec-05-10.data deleted file mode 100644 index bab2c1b89ca..00000000000 --- a/test/YAMLParser/spec-05-10.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s 2>&1 | FileCheck %s - -commercial-at: @text -grave-accent: `text - -# CHECK: error diff --git a/test/YAMLParser/spec-05-10.test b/test/YAMLParser/spec-05-10.test new file mode 100644 index 00000000000..14112c1eed5 --- /dev/null +++ b/test/YAMLParser/spec-05-10.test @@ -0,0 +1,6 @@ +# RUN: not yaml-bench -canonical %s 2>&1 | FileCheck %s + +commercial-at: @text +grave-accent: `text + +# CHECK: error diff --git a/test/YAMLParser/spec-05-11.data b/test/YAMLParser/spec-05-11.data deleted file mode 100644 index 7cba5562d5f..00000000000 --- a/test/YAMLParser/spec-05-11.data +++ /dev/null @@ -1,5 +0,0 @@ -# RUN: yaml-bench -canonical %s - -| - Generic line break (no glyph) - Generic line break (glyphed)… Line separator
 Paragraph separator
 diff --git a/test/YAMLParser/spec-05-11.test b/test/YAMLParser/spec-05-11.test new file mode 100644 index 00000000000..7cba5562d5f --- /dev/null +++ b/test/YAMLParser/spec-05-11.test @@ -0,0 +1,5 @@ +# RUN: yaml-bench -canonical %s + +| + Generic line break (no glyph) + Generic line break (glyphed)… Line separator
 Paragraph separator
 diff --git a/test/YAMLParser/spec-05-12.data b/test/YAMLParser/spec-05-12.data deleted file mode 100644 index eedfc08cf38..00000000000 --- a/test/YAMLParser/spec-05-12.data +++ /dev/null @@ -1,16 +0,0 @@ -# RUN: yaml-bench -canonical %s 2>&1 | FileCheck %s -# -# We don't currently reject tabs as indentation. -# XFAIL: * - -# Tabs do's and don'ts: -# comment: -quoted: "Quoted " -block: | - void main() { - printf("Hello, world!\n"); - } -elsewhere: # separation - indentation, in plain scalar - -# CHECK: error diff --git a/test/YAMLParser/spec-05-12.test b/test/YAMLParser/spec-05-12.test new file mode 100644 index 00000000000..7ecc36dee8b --- /dev/null +++ b/test/YAMLParser/spec-05-12.test @@ -0,0 +1,18 @@ +# RUN: yaml-bench -canonical %s 2>&1 | FileCheck %s +# +# FIXME: This test should actually fail. Yaml-bench should report an error +# that a tab is being used to indent a plain scalar at line 15. +# We don't currently reject tabs as indentation. + +# Tabs do's and don'ts: +# comment: +quoted: "Quoted " +block: | + void main() { + printf("Hello, world!\n"); + } +elsewhere: # separation + indentation, in plain scalar + + +# CHECK: !!str "Quoted\t\t" diff --git a/test/YAMLParser/spec-05-13.data b/test/YAMLParser/spec-05-13.data deleted file mode 100644 index db62e866a75..00000000000 --- a/test/YAMLParser/spec-05-13.data +++ /dev/null @@ -1,5 +0,0 @@ -# RUN: yaml-bench -canonical %s - - "Text containing - both space and - tab characters" diff --git a/test/YAMLParser/spec-05-13.test b/test/YAMLParser/spec-05-13.test new file mode 100644 index 00000000000..db62e866a75 --- /dev/null +++ b/test/YAMLParser/spec-05-13.test @@ -0,0 +1,5 @@ +# RUN: yaml-bench -canonical %s + + "Text containing + both space and + tab characters" diff --git a/test/YAMLParser/spec-05-14.data b/test/YAMLParser/spec-05-14.data deleted file mode 100644 index 65451651b69..00000000000 --- a/test/YAMLParser/spec-05-14.data +++ /dev/null @@ -1,9 +0,0 @@ -# RUN: yaml-bench -canonical %s - -"Fun with \\ -\" \a \b \e \f \ -\n \r \t \v \0 \ -\ \_ \N \L \P \ -\x41 \u0041 \U00000041" - -# CHECK: !!str "Fun with \\\n\" \a \b \e \f \n \r \t \v \0 \_ \N \L \P A A A" diff --git a/test/YAMLParser/spec-05-14.test b/test/YAMLParser/spec-05-14.test new file mode 100644 index 00000000000..65451651b69 --- /dev/null +++ b/test/YAMLParser/spec-05-14.test @@ -0,0 +1,9 @@ +# RUN: yaml-bench -canonical %s + +"Fun with \\ +\" \a \b \e \f \ +\n \r \t \v \0 \ +\ \_ \N \L \P \ +\x41 \u0041 \U00000041" + +# CHECK: !!str "Fun with \\\n\" \a \b \e \f \n \r \t \v \0 \_ \N \L \P A A A" diff --git a/test/YAMLParser/spec-05-15.data b/test/YAMLParser/spec-05-15.data deleted file mode 100644 index 27dbd8396ea..00000000000 --- a/test/YAMLParser/spec-05-15.data +++ /dev/null @@ -1,7 +0,0 @@ -# RUN: yaml-bench -canonical %s 2>&1 | FileCheck %s - -Bad escapes: - "\c - \xq-" - -# CHECK: error diff --git a/test/YAMLParser/spec-05-15.test b/test/YAMLParser/spec-05-15.test new file mode 100644 index 00000000000..46228bae215 --- /dev/null +++ b/test/YAMLParser/spec-05-15.test @@ -0,0 +1,7 @@ +# RUN: not yaml-bench -canonical %s 2>&1 | FileCheck %s + +Bad escapes: + "\c + \xq-" + +# CHECK: error diff --git a/test/YAMLParser/spec-06-01.data b/test/YAMLParser/spec-06-01.data deleted file mode 100644 index 95b26bdb385..00000000000 --- a/test/YAMLParser/spec-06-01.data +++ /dev/null @@ -1,16 +0,0 @@ -# RUN: yaml-bench -canonical %s - - # Leading comment line spaces are - # neither content nor indentation. - -Not indented: - By one space: | - By four - spaces - Flow style: [ # Leading spaces - By two, # in flow style - Also by two, # are neither -# Tabs are not allowed: -# Still by two # content nor - Still by two # content nor - ] # indentation. diff --git a/test/YAMLParser/spec-06-01.test b/test/YAMLParser/spec-06-01.test new file mode 100644 index 00000000000..95b26bdb385 --- /dev/null +++ b/test/YAMLParser/spec-06-01.test @@ -0,0 +1,16 @@ +# RUN: yaml-bench -canonical %s + + # Leading comment line spaces are + # neither content nor indentation. + +Not indented: + By one space: | + By four + spaces + Flow style: [ # Leading spaces + By two, # in flow style + Also by two, # are neither +# Tabs are not allowed: +# Still by two # content nor + Still by two # content nor + ] # indentation. diff --git a/test/YAMLParser/spec-06-02.data b/test/YAMLParser/spec-06-02.data deleted file mode 100644 index 40a15c9f3ea..00000000000 --- a/test/YAMLParser/spec-06-02.data +++ /dev/null @@ -1,5 +0,0 @@ -# RUN: yaml-bench -canonical %s - - # Comment - - diff --git a/test/YAMLParser/spec-06-02.test b/test/YAMLParser/spec-06-02.test new file mode 100644 index 00000000000..40a15c9f3ea --- /dev/null +++ b/test/YAMLParser/spec-06-02.test @@ -0,0 +1,5 @@ +# RUN: yaml-bench -canonical %s + + # Comment + + diff --git a/test/YAMLParser/spec-06-03.data b/test/YAMLParser/spec-06-03.data deleted file mode 100644 index c1893ef0832..00000000000 --- a/test/YAMLParser/spec-06-03.data +++ /dev/null @@ -1,4 +0,0 @@ -# RUN: yaml-bench -canonical %s - -key: # Comment - value diff --git a/test/YAMLParser/spec-06-03.test b/test/YAMLParser/spec-06-03.test new file mode 100644 index 00000000000..c1893ef0832 --- /dev/null +++ b/test/YAMLParser/spec-06-03.test @@ -0,0 +1,4 @@ +# RUN: yaml-bench -canonical %s + +key: # Comment + value diff --git a/test/YAMLParser/spec-06-04.data b/test/YAMLParser/spec-06-04.data deleted file mode 100644 index b61bcc6b955..00000000000 --- a/test/YAMLParser/spec-06-04.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - -key: # Comment - # lines - value - diff --git a/test/YAMLParser/spec-06-04.test b/test/YAMLParser/spec-06-04.test new file mode 100644 index 00000000000..b61bcc6b955 --- /dev/null +++ b/test/YAMLParser/spec-06-04.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +key: # Comment + # lines + value + diff --git a/test/YAMLParser/spec-06-05.data b/test/YAMLParser/spec-06-05.data deleted file mode 100644 index 4bcaa5a8189..00000000000 --- a/test/YAMLParser/spec-06-05.data +++ /dev/null @@ -1,8 +0,0 @@ -# RUN: yaml-bench -canonical %s - -{ first: Sammy, last: Sosa }: -# Statistics: - hr: # Home runs - 65 - avg: # Average - 0.278 diff --git a/test/YAMLParser/spec-06-05.test b/test/YAMLParser/spec-06-05.test new file mode 100644 index 00000000000..4bcaa5a8189 --- /dev/null +++ b/test/YAMLParser/spec-06-05.test @@ -0,0 +1,8 @@ +# RUN: yaml-bench -canonical %s + +{ first: Sammy, last: Sosa }: +# Statistics: + hr: # Home runs + 65 + avg: # Average + 0.278 diff --git a/test/YAMLParser/spec-06-06.data b/test/YAMLParser/spec-06-06.data deleted file mode 100644 index 67e39ddf899..00000000000 --- a/test/YAMLParser/spec-06-06.data +++ /dev/null @@ -1,9 +0,0 @@ -# RUN: yaml-bench -canonical %s - -plain: text - lines -quoted: "text - lines" -block: | - text - lines diff --git a/test/YAMLParser/spec-06-06.test b/test/YAMLParser/spec-06-06.test new file mode 100644 index 00000000000..67e39ddf899 --- /dev/null +++ b/test/YAMLParser/spec-06-06.test @@ -0,0 +1,9 @@ +# RUN: yaml-bench -canonical %s + +plain: text + lines +quoted: "text + lines" +block: | + text + lines diff --git a/test/YAMLParser/spec-06-07.data b/test/YAMLParser/spec-06-07.data deleted file mode 100644 index 451bd349e3e..00000000000 --- a/test/YAMLParser/spec-06-07.data +++ /dev/null @@ -1,10 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- foo - - bar -- |- - foo - - bar - diff --git a/test/YAMLParser/spec-06-07.test b/test/YAMLParser/spec-06-07.test new file mode 100644 index 00000000000..451bd349e3e --- /dev/null +++ b/test/YAMLParser/spec-06-07.test @@ -0,0 +1,10 @@ +# RUN: yaml-bench -canonical %s + +- foo + + bar +- |- + foo + + bar + diff --git a/test/YAMLParser/spec-06-08.data b/test/YAMLParser/spec-06-08.data deleted file mode 100644 index aa06f847ea3..00000000000 --- a/test/YAMLParser/spec-06-08.data +++ /dev/null @@ -1,4 +0,0 @@ -# RUN: yaml-bench -canonical %s - ->- - specific
 trimmed… … …… as… space diff --git a/test/YAMLParser/spec-06-08.test b/test/YAMLParser/spec-06-08.test new file mode 100644 index 00000000000..aa06f847ea3 --- /dev/null +++ b/test/YAMLParser/spec-06-08.test @@ -0,0 +1,4 @@ +# RUN: yaml-bench -canonical %s + +>- + specific
 trimmed… … …… as… space diff --git a/test/YAMLParser/spec-07-01.data b/test/YAMLParser/spec-07-01.data deleted file mode 100644 index 21bc5e59d59..00000000000 --- a/test/YAMLParser/spec-07-01.data +++ /dev/null @@ -1,5 +0,0 @@ -# RUN: yaml-bench -canonical %s - -%FOO bar baz # Should be ignored - # with a warning. ---- "foo" diff --git a/test/YAMLParser/spec-07-01.test b/test/YAMLParser/spec-07-01.test new file mode 100644 index 00000000000..21bc5e59d59 --- /dev/null +++ b/test/YAMLParser/spec-07-01.test @@ -0,0 +1,5 @@ +# RUN: yaml-bench -canonical %s + +%FOO bar baz # Should be ignored + # with a warning. +--- "foo" diff --git a/test/YAMLParser/spec-07-02.data b/test/YAMLParser/spec-07-02.data deleted file mode 100644 index bf0e758c880..00000000000 --- a/test/YAMLParser/spec-07-02.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - -%YAML 1.2 # Attempt parsing - # with a warning ---- -"foo" diff --git a/test/YAMLParser/spec-07-02.test b/test/YAMLParser/spec-07-02.test new file mode 100644 index 00000000000..bf0e758c880 --- /dev/null +++ b/test/YAMLParser/spec-07-02.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +%YAML 1.2 # Attempt parsing + # with a warning +--- +"foo" diff --git a/test/YAMLParser/spec-07-03.data b/test/YAMLParser/spec-07-03.data deleted file mode 100644 index c4a5299562a..00000000000 --- a/test/YAMLParser/spec-07-03.data +++ /dev/null @@ -1,7 +0,0 @@ -# RUN: yaml-bench -canonical %s 2>&1 | FileCheck %s - -%YAML 1.1 -%YAML 1.1 -foo - -# CHECK: error diff --git a/test/YAMLParser/spec-07-03.test b/test/YAMLParser/spec-07-03.test new file mode 100644 index 00000000000..76266b896d7 --- /dev/null +++ b/test/YAMLParser/spec-07-03.test @@ -0,0 +1,7 @@ +# RUN: not yaml-bench -canonical %s 2>&1 | FileCheck %s + +%YAML 1.1 +%YAML 1.1 +foo + +# CHECK: error diff --git a/test/YAMLParser/spec-07-04.data b/test/YAMLParser/spec-07-04.data deleted file mode 100644 index 2c8b2ec6959..00000000000 --- a/test/YAMLParser/spec-07-04.data +++ /dev/null @@ -1,7 +0,0 @@ -# RUN: yaml-bench -canonical %s | FileCheck %s - -%TAG !yaml! tag:yaml.org,2002: ---- -!yaml!str "foo" - -#CHECK: !!str "foo" diff --git a/test/YAMLParser/spec-07-04.test b/test/YAMLParser/spec-07-04.test new file mode 100644 index 00000000000..2c8b2ec6959 --- /dev/null +++ b/test/YAMLParser/spec-07-04.test @@ -0,0 +1,7 @@ +# RUN: yaml-bench -canonical %s | FileCheck %s + +%TAG !yaml! tag:yaml.org,2002: +--- +!yaml!str "foo" + +#CHECK: !!str "foo" diff --git a/test/YAMLParser/spec-07-05.data b/test/YAMLParser/spec-07-05.data deleted file mode 100644 index f7cff3a8390..00000000000 --- a/test/YAMLParser/spec-07-05.data +++ /dev/null @@ -1,10 +0,0 @@ -# RUN: yaml-bench -canonical %s 2>&1 | FileCheck %s -# -# We don't currently parse TAG directives. -# XFAIL: * - -%TAG ! !foo -%TAG ! !foo -bar - -# CHECK: error diff --git a/test/YAMLParser/spec-07-05.test b/test/YAMLParser/spec-07-05.test new file mode 100644 index 00000000000..447cba81902 --- /dev/null +++ b/test/YAMLParser/spec-07-05.test @@ -0,0 +1,8 @@ +# RUN: not yaml-bench -canonical %s 2>&1 | FileCheck %s +# +# We don't currently parse TAG directives. +# CHECK: error: Unexpected token + +%TAG ! !foo +%TAG ! !foo +bar diff --git a/test/YAMLParser/spec-07-06.data b/test/YAMLParser/spec-07-06.data deleted file mode 100644 index 9f27f91f311..00000000000 --- a/test/YAMLParser/spec-07-06.data +++ /dev/null @@ -1,7 +0,0 @@ -# RUN: yaml-bench -canonical %s - -%TAG ! !foo -%TAG !yaml! tag:yaml.org,2002: ---- -- !bar "baz" -- !yaml!str "string" diff --git a/test/YAMLParser/spec-07-06.test b/test/YAMLParser/spec-07-06.test new file mode 100644 index 00000000000..9f27f91f311 --- /dev/null +++ b/test/YAMLParser/spec-07-06.test @@ -0,0 +1,7 @@ +# RUN: yaml-bench -canonical %s + +%TAG ! !foo +%TAG !yaml! tag:yaml.org,2002: +--- +- !bar "baz" +- !yaml!str "string" diff --git a/test/YAMLParser/spec-07-07a.data b/test/YAMLParser/spec-07-07a.data deleted file mode 100644 index e51f8f7d694..00000000000 --- a/test/YAMLParser/spec-07-07a.data +++ /dev/null @@ -1,4 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# Private application: -!foo "bar" diff --git a/test/YAMLParser/spec-07-07a.test b/test/YAMLParser/spec-07-07a.test new file mode 100644 index 00000000000..e51f8f7d694 --- /dev/null +++ b/test/YAMLParser/spec-07-07a.test @@ -0,0 +1,4 @@ +# RUN: yaml-bench -canonical %s + +# Private application: +!foo "bar" diff --git a/test/YAMLParser/spec-07-07b.data b/test/YAMLParser/spec-07-07b.data deleted file mode 100644 index 003d5755726..00000000000 --- a/test/YAMLParser/spec-07-07b.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# Migrated to global: -%TAG ! tag:ben-kiki.org,2000:app/ ---- -!foo "bar" diff --git a/test/YAMLParser/spec-07-07b.test b/test/YAMLParser/spec-07-07b.test new file mode 100644 index 00000000000..003d5755726 --- /dev/null +++ b/test/YAMLParser/spec-07-07b.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +# Migrated to global: +%TAG ! tag:ben-kiki.org,2000:app/ +--- +!foo "bar" diff --git a/test/YAMLParser/spec-07-08.data b/test/YAMLParser/spec-07-08.data deleted file mode 100644 index 7197404b384..00000000000 --- a/test/YAMLParser/spec-07-08.data +++ /dev/null @@ -1,11 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# Explicitly specify default settings: -%TAG ! ! -%TAG !! tag:yaml.org,2002: -# Named handles have no default: -%TAG !o! tag:ben-kiki.org,2000: ---- -- !foo "bar" -- !!str "string" -- !o!type "baz" diff --git a/test/YAMLParser/spec-07-08.test b/test/YAMLParser/spec-07-08.test new file mode 100644 index 00000000000..7197404b384 --- /dev/null +++ b/test/YAMLParser/spec-07-08.test @@ -0,0 +1,11 @@ +# RUN: yaml-bench -canonical %s + +# Explicitly specify default settings: +%TAG ! ! +%TAG !! tag:yaml.org,2002: +# Named handles have no default: +%TAG !o! tag:ben-kiki.org,2000: +--- +- !foo "bar" +- !!str "string" +- !o!type "baz" diff --git a/test/YAMLParser/spec-07-09.data b/test/YAMLParser/spec-07-09.data deleted file mode 100644 index 1f98ba04146..00000000000 --- a/test/YAMLParser/spec-07-09.data +++ /dev/null @@ -1,13 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- -foo -... -# Repeated end marker. -... ---- -bar -# No end marker. ---- -baz -... diff --git a/test/YAMLParser/spec-07-09.test b/test/YAMLParser/spec-07-09.test new file mode 100644 index 00000000000..1f98ba04146 --- /dev/null +++ b/test/YAMLParser/spec-07-09.test @@ -0,0 +1,13 @@ +# RUN: yaml-bench -canonical %s + +--- +foo +... +# Repeated end marker. +... +--- +bar +# No end marker. +--- +baz +... diff --git a/test/YAMLParser/spec-07-10.data b/test/YAMLParser/spec-07-10.data deleted file mode 100644 index a1766834781..00000000000 --- a/test/YAMLParser/spec-07-10.data +++ /dev/null @@ -1,13 +0,0 @@ -# RUN: yaml-bench -canonical %s - -"Root flow - scalar" ---- !!str > - Root block - scalar ---- -# Root collection: -foo : bar -... # Is optional. ---- -# Explicit document may be empty. diff --git a/test/YAMLParser/spec-07-10.test b/test/YAMLParser/spec-07-10.test new file mode 100644 index 00000000000..a1766834781 --- /dev/null +++ b/test/YAMLParser/spec-07-10.test @@ -0,0 +1,13 @@ +# RUN: yaml-bench -canonical %s + +"Root flow + scalar" +--- !!str > + Root block + scalar +--- +# Root collection: +foo : bar +... # Is optional. +--- +# Explicit document may be empty. diff --git a/test/YAMLParser/spec-07-11.data b/test/YAMLParser/spec-07-11.data deleted file mode 100644 index ce14b7ebe4d..00000000000 --- a/test/YAMLParser/spec-07-11.data +++ /dev/null @@ -1,4 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# A stream may contain -# no documents. diff --git a/test/YAMLParser/spec-07-11.test b/test/YAMLParser/spec-07-11.test new file mode 100644 index 00000000000..ce14b7ebe4d --- /dev/null +++ b/test/YAMLParser/spec-07-11.test @@ -0,0 +1,4 @@ +# RUN: yaml-bench -canonical %s + +# A stream may contain +# no documents. diff --git a/test/YAMLParser/spec-07-12a.data b/test/YAMLParser/spec-07-12a.data deleted file mode 100644 index 7327f8188e0..00000000000 --- a/test/YAMLParser/spec-07-12a.data +++ /dev/null @@ -1,5 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# Implicit document. Root -# collection (mapping) node. -foo : bar diff --git a/test/YAMLParser/spec-07-12a.test b/test/YAMLParser/spec-07-12a.test new file mode 100644 index 00000000000..7327f8188e0 --- /dev/null +++ b/test/YAMLParser/spec-07-12a.test @@ -0,0 +1,5 @@ +# RUN: yaml-bench -canonical %s + +# Implicit document. Root +# collection (mapping) node. +foo : bar diff --git a/test/YAMLParser/spec-07-12b.data b/test/YAMLParser/spec-07-12b.data deleted file mode 100644 index d759abea7d4..00000000000 --- a/test/YAMLParser/spec-07-12b.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# Explicit document. Root -# scalar (literal) node. ---- | - Text content diff --git a/test/YAMLParser/spec-07-12b.test b/test/YAMLParser/spec-07-12b.test new file mode 100644 index 00000000000..d759abea7d4 --- /dev/null +++ b/test/YAMLParser/spec-07-12b.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +# Explicit document. Root +# scalar (literal) node. +--- | + Text content diff --git a/test/YAMLParser/spec-07-13.data b/test/YAMLParser/spec-07-13.data deleted file mode 100644 index ab74df10187..00000000000 --- a/test/YAMLParser/spec-07-13.data +++ /dev/null @@ -1,11 +0,0 @@ -# RUN: yaml-bench -canonical %s - -! "First document" ---- -!foo "No directives" -%TAG ! !foo ---- -!bar "With directives" -%YAML 1.1 ---- -!baz "Reset settings" diff --git a/test/YAMLParser/spec-07-13.test b/test/YAMLParser/spec-07-13.test new file mode 100644 index 00000000000..ab74df10187 --- /dev/null +++ b/test/YAMLParser/spec-07-13.test @@ -0,0 +1,11 @@ +# RUN: yaml-bench -canonical %s + +! "First document" +--- +!foo "No directives" +%TAG ! !foo +--- +!bar "With directives" +%YAML 1.1 +--- +!baz "Reset settings" diff --git a/test/YAMLParser/spec-08-01.data b/test/YAMLParser/spec-08-01.data deleted file mode 100644 index 5abbfa80949..00000000000 --- a/test/YAMLParser/spec-08-01.data +++ /dev/null @@ -1,4 +0,0 @@ -# RUN: yaml-bench -canonical %s - -!!str &a1 "foo" : !!str bar -&a2 baz : *a1 diff --git a/test/YAMLParser/spec-08-01.test b/test/YAMLParser/spec-08-01.test new file mode 100644 index 00000000000..5abbfa80949 --- /dev/null +++ b/test/YAMLParser/spec-08-01.test @@ -0,0 +1,4 @@ +# RUN: yaml-bench -canonical %s + +!!str &a1 "foo" : !!str bar +&a2 baz : *a1 diff --git a/test/YAMLParser/spec-08-02.data b/test/YAMLParser/spec-08-02.data deleted file mode 100644 index 8a75783a709..00000000000 --- a/test/YAMLParser/spec-08-02.data +++ /dev/null @@ -1,4 +0,0 @@ -# RUN: yaml-bench -canonical %s - -First occurrence: &anchor Value -Second occurrence: *anchor diff --git a/test/YAMLParser/spec-08-02.test b/test/YAMLParser/spec-08-02.test new file mode 100644 index 00000000000..8a75783a709 --- /dev/null +++ b/test/YAMLParser/spec-08-02.test @@ -0,0 +1,4 @@ +# RUN: yaml-bench -canonical %s + +First occurrence: &anchor Value +Second occurrence: *anchor diff --git a/test/YAMLParser/spec-08-03.data b/test/YAMLParser/spec-08-03.data deleted file mode 100644 index 8c715305a81..00000000000 --- a/test/YAMLParser/spec-08-03.data +++ /dev/null @@ -1,4 +0,0 @@ -# RUN: yaml-bench -canonical %s - -! foo : - ! baz diff --git a/test/YAMLParser/spec-08-03.test b/test/YAMLParser/spec-08-03.test new file mode 100644 index 00000000000..8c715305a81 --- /dev/null +++ b/test/YAMLParser/spec-08-03.test @@ -0,0 +1,4 @@ +# RUN: yaml-bench -canonical %s + +! foo : + ! baz diff --git a/test/YAMLParser/spec-08-04.data b/test/YAMLParser/spec-08-04.data deleted file mode 100644 index 73c493d7637..00000000000 --- a/test/YAMLParser/spec-08-04.data +++ /dev/null @@ -1,9 +0,0 @@ -# RUN: yaml-bench -canonical %s 2>&1 | FileCheck %s -# -# We don't currently look at the content of literal tags. -# XFAIL: * - -- ! foo -- !<$:?> bar - -# CHECK: error diff --git a/test/YAMLParser/spec-08-04.test b/test/YAMLParser/spec-08-04.test new file mode 100644 index 00000000000..5b502ae3a17 --- /dev/null +++ b/test/YAMLParser/spec-08-04.test @@ -0,0 +1,7 @@ +# RUN: not yaml-bench -canonical %s 2>&1 | FileCheck %s +# +# We don't currently look at the content of literal tags. +# CHECK: error: Unknown tag handle + +- ! foo +- !<$:?> bar diff --git a/test/YAMLParser/spec-08-05.data b/test/YAMLParser/spec-08-05.data deleted file mode 100644 index 0613446c897..00000000000 --- a/test/YAMLParser/spec-08-05.data +++ /dev/null @@ -1,7 +0,0 @@ -# RUN: yaml-bench -canonical %s - -%TAG !o! tag:ben-kiki.org,2000: ---- -- !local foo -- !!str bar -- !o!type baz diff --git a/test/YAMLParser/spec-08-05.test b/test/YAMLParser/spec-08-05.test new file mode 100644 index 00000000000..0613446c897 --- /dev/null +++ b/test/YAMLParser/spec-08-05.test @@ -0,0 +1,7 @@ +# RUN: yaml-bench -canonical %s + +%TAG !o! tag:ben-kiki.org,2000: +--- +- !local foo +- !!str bar +- !o!type baz diff --git a/test/YAMLParser/spec-08-06.data b/test/YAMLParser/spec-08-06.data deleted file mode 100644 index 9844f53a4ef..00000000000 --- a/test/YAMLParser/spec-08-06.data +++ /dev/null @@ -1,12 +0,0 @@ -# RUN: yaml-bench -canonical %s 2>&1 | FileCheck %s -# -# We don't currently validate tags. -# XFAIL: * - -%TAG !o! tag:ben-kiki.org,2000: ---- -- !$a!b foo -- !o! bar -- !h!type baz - -# CHECK: error diff --git a/test/YAMLParser/spec-08-06.test b/test/YAMLParser/spec-08-06.test new file mode 100644 index 00000000000..b457d59b569 --- /dev/null +++ b/test/YAMLParser/spec-08-06.test @@ -0,0 +1,11 @@ +# RUN: not yaml-bench -canonical %s 2>&1 | FileCheck %s +# +# We don't currently validate tags. +# CHECK: error: Unknown tag handle + +%TAG !o! tag:ben-kiki.org,2000: +--- +- !$a!b foo +- !o! bar +- !h!type baz + diff --git a/test/YAMLParser/spec-08-07.data b/test/YAMLParser/spec-08-07.data deleted file mode 100644 index fc3f2df7f05..00000000000 --- a/test/YAMLParser/spec-08-07.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# Assuming conventional resolution: -- "12" -- 12 -- ! 12 diff --git a/test/YAMLParser/spec-08-07.test b/test/YAMLParser/spec-08-07.test new file mode 100644 index 00000000000..fc3f2df7f05 --- /dev/null +++ b/test/YAMLParser/spec-08-07.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +# Assuming conventional resolution: +- "12" +- 12 +- ! 12 diff --git a/test/YAMLParser/spec-08-08.data b/test/YAMLParser/spec-08-08.data deleted file mode 100644 index 460029f6ace..00000000000 --- a/test/YAMLParser/spec-08-08.data +++ /dev/null @@ -1,15 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- -foo: - "bar - baz" ---- -"foo - bar" ---- -foo - bar ---- | - foo -... diff --git a/test/YAMLParser/spec-08-08.test b/test/YAMLParser/spec-08-08.test new file mode 100644 index 00000000000..460029f6ace --- /dev/null +++ b/test/YAMLParser/spec-08-08.test @@ -0,0 +1,15 @@ +# RUN: yaml-bench -canonical %s + +--- +foo: + "bar + baz" +--- +"foo + bar" +--- +foo + bar +--- | + foo +... diff --git a/test/YAMLParser/spec-08-09.data b/test/YAMLParser/spec-08-09.data deleted file mode 100644 index 1c825859431..00000000000 --- a/test/YAMLParser/spec-08-09.data +++ /dev/null @@ -1,13 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- -scalars: - plain: !!str some text - quoted: - single: 'some text' - double: "some text" -collections: - sequence: !!seq [ !!str entry, - # Mapping entry: - key: value ] - mapping: { key: value } diff --git a/test/YAMLParser/spec-08-09.test b/test/YAMLParser/spec-08-09.test new file mode 100644 index 00000000000..1c825859431 --- /dev/null +++ b/test/YAMLParser/spec-08-09.test @@ -0,0 +1,13 @@ +# RUN: yaml-bench -canonical %s + +--- +scalars: + plain: !!str some text + quoted: + single: 'some text' + double: "some text" +collections: + sequence: !!seq [ !!str entry, + # Mapping entry: + key: value ] + mapping: { key: value } diff --git a/test/YAMLParser/spec-08-10.data b/test/YAMLParser/spec-08-10.data deleted file mode 100644 index 74054eb0883..00000000000 --- a/test/YAMLParser/spec-08-10.data +++ /dev/null @@ -1,17 +0,0 @@ -# RUN: yaml-bench -canonical %s - -block styles: - scalars: - literal: !!str | - #!/usr/bin/perl - print "Hello, world!\n"; - folded: > - This sentence - is false. - collections: !!map - sequence: !!seq # Entry: - - entry # Plain - # Mapping entry: - - key: value - mapping: - key: value diff --git a/test/YAMLParser/spec-08-10.test b/test/YAMLParser/spec-08-10.test new file mode 100644 index 00000000000..74054eb0883 --- /dev/null +++ b/test/YAMLParser/spec-08-10.test @@ -0,0 +1,17 @@ +# RUN: yaml-bench -canonical %s + +block styles: + scalars: + literal: !!str | + #!/usr/bin/perl + print "Hello, world!\n"; + folded: > + This sentence + is false. + collections: !!map + sequence: !!seq # Entry: + - entry # Plain + # Mapping entry: + - key: value + mapping: + key: value diff --git a/test/YAMLParser/spec-08-11.data b/test/YAMLParser/spec-08-11.data deleted file mode 100644 index 8a75783a709..00000000000 --- a/test/YAMLParser/spec-08-11.data +++ /dev/null @@ -1,4 +0,0 @@ -# RUN: yaml-bench -canonical %s - -First occurrence: &anchor Value -Second occurrence: *anchor diff --git a/test/YAMLParser/spec-08-11.test b/test/YAMLParser/spec-08-11.test new file mode 100644 index 00000000000..8a75783a709 --- /dev/null +++ b/test/YAMLParser/spec-08-11.test @@ -0,0 +1,4 @@ +# RUN: yaml-bench -canonical %s + +First occurrence: &anchor Value +Second occurrence: *anchor diff --git a/test/YAMLParser/spec-08-12.data b/test/YAMLParser/spec-08-12.data deleted file mode 100644 index 69e78b42d27..00000000000 --- a/test/YAMLParser/spec-08-12.data +++ /dev/null @@ -1,10 +0,0 @@ -# RUN: yaml-bench -canonical %s - -[ - Without properties, - &anchor "Anchored", - !!str 'Tagged', - *anchor, # Alias node - !!str , # Empty plain scalar - '', # Empty plain scalar -] diff --git a/test/YAMLParser/spec-08-12.test b/test/YAMLParser/spec-08-12.test new file mode 100644 index 00000000000..69e78b42d27 --- /dev/null +++ b/test/YAMLParser/spec-08-12.test @@ -0,0 +1,10 @@ +# RUN: yaml-bench -canonical %s + +[ + Without properties, + &anchor "Anchored", + !!str 'Tagged', + *anchor, # Alias node + !!str , # Empty plain scalar + '', # Empty plain scalar +] diff --git a/test/YAMLParser/spec-08-13.data b/test/YAMLParser/spec-08-13.data deleted file mode 100644 index 931d56a0cfe..00000000000 --- a/test/YAMLParser/spec-08-13.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - -{ - ? foo :, - ? : bar, -} diff --git a/test/YAMLParser/spec-08-13.test b/test/YAMLParser/spec-08-13.test new file mode 100644 index 00000000000..931d56a0cfe --- /dev/null +++ b/test/YAMLParser/spec-08-13.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +{ + ? foo :, + ? : bar, +} diff --git a/test/YAMLParser/spec-08-14.data b/test/YAMLParser/spec-08-14.data deleted file mode 100644 index 61c448351ae..00000000000 --- a/test/YAMLParser/spec-08-14.data +++ /dev/null @@ -1,7 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- "flow in block" -- > - Block scalar -- !!map # Block collection - foo : bar diff --git a/test/YAMLParser/spec-08-14.test b/test/YAMLParser/spec-08-14.test new file mode 100644 index 00000000000..61c448351ae --- /dev/null +++ b/test/YAMLParser/spec-08-14.test @@ -0,0 +1,7 @@ +# RUN: yaml-bench -canonical %s + +- "flow in block" +- > + Block scalar +- !!map # Block collection + foo : bar diff --git a/test/YAMLParser/spec-08-15.data b/test/YAMLParser/spec-08-15.data deleted file mode 100644 index f21e84a4314..00000000000 --- a/test/YAMLParser/spec-08-15.data +++ /dev/null @@ -1,7 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- # Empty plain scalar -- ? foo - : - ? - : bar diff --git a/test/YAMLParser/spec-08-15.test b/test/YAMLParser/spec-08-15.test new file mode 100644 index 00000000000..f21e84a4314 --- /dev/null +++ b/test/YAMLParser/spec-08-15.test @@ -0,0 +1,7 @@ +# RUN: yaml-bench -canonical %s + +- # Empty plain scalar +- ? foo + : + ? + : bar diff --git a/test/YAMLParser/spec-09-01.data b/test/YAMLParser/spec-09-01.data deleted file mode 100644 index 8999b496162..00000000000 --- a/test/YAMLParser/spec-09-01.data +++ /dev/null @@ -1,8 +0,0 @@ -# RUN: yaml-bench -canonical %s - -"simple key" : { - "also simple" : value, - ? "not a - simple key" : "any - value" -} diff --git a/test/YAMLParser/spec-09-01.test b/test/YAMLParser/spec-09-01.test new file mode 100644 index 00000000000..8999b496162 --- /dev/null +++ b/test/YAMLParser/spec-09-01.test @@ -0,0 +1,8 @@ +# RUN: yaml-bench -canonical %s + +"simple key" : { + "also simple" : value, + ? "not a + simple key" : "any + value" +} diff --git a/test/YAMLParser/spec-09-02.data b/test/YAMLParser/spec-09-02.data deleted file mode 100644 index 9d8a58ca33a..00000000000 --- a/test/YAMLParser/spec-09-02.data +++ /dev/null @@ -1,14 +0,0 @@ -# RUN: yaml-bench -canonical %s 2>&1 | FileCheck %s -# -# Indent trimming is not yet implemented. -# XFAIL: * - - "as space - trimmed - - specific - - escaped \ - none" - -# CHECK: !!str "as space trimmed\nspecific\nescaped\tnone" diff --git a/test/YAMLParser/spec-09-02.test b/test/YAMLParser/spec-09-02.test new file mode 100644 index 00000000000..3f8e49a8bd3 --- /dev/null +++ b/test/YAMLParser/spec-09-02.test @@ -0,0 +1,14 @@ +# RUN: yaml-bench -canonical %s 2>&1 | FileCheck %s + + "as space + trimmed + + specific + + escaped \ + none" + +# FIXME: The string below should actually be +# "as space trimmed\nspecific\nescaped\tnone", but the parser currently has +# a bug when parsing multiline quoted strings. +# CHECK: !!str "as space\n trimmed\n specific\n escaped\t none" diff --git a/test/YAMLParser/spec-09-03.data b/test/YAMLParser/spec-09-03.data deleted file mode 100644 index 3fb0d8b184a..00000000000 --- a/test/YAMLParser/spec-09-03.data +++ /dev/null @@ -1,8 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- " - last" -- " - last" -- " first - last" diff --git a/test/YAMLParser/spec-09-03.test b/test/YAMLParser/spec-09-03.test new file mode 100644 index 00000000000..3fb0d8b184a --- /dev/null +++ b/test/YAMLParser/spec-09-03.test @@ -0,0 +1,8 @@ +# RUN: yaml-bench -canonical %s + +- " + last" +- " + last" +- " first + last" diff --git a/test/YAMLParser/spec-09-04.data b/test/YAMLParser/spec-09-04.data deleted file mode 100644 index 4178ec6befb..00000000000 --- a/test/YAMLParser/spec-09-04.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - - "first - inner 1 - \ inner 2 \ - last" diff --git a/test/YAMLParser/spec-09-04.test b/test/YAMLParser/spec-09-04.test new file mode 100644 index 00000000000..4178ec6befb --- /dev/null +++ b/test/YAMLParser/spec-09-04.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + + "first + inner 1 + \ inner 2 \ + last" diff --git a/test/YAMLParser/spec-09-05.data b/test/YAMLParser/spec-09-05.data deleted file mode 100644 index e482d536623..00000000000 --- a/test/YAMLParser/spec-09-05.data +++ /dev/null @@ -1,10 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- "first - " -- "first - - last" -- "first - inner - \ last" diff --git a/test/YAMLParser/spec-09-05.test b/test/YAMLParser/spec-09-05.test new file mode 100644 index 00000000000..e482d536623 --- /dev/null +++ b/test/YAMLParser/spec-09-05.test @@ -0,0 +1,10 @@ +# RUN: yaml-bench -canonical %s + +- "first + " +- "first + + last" +- "first + inner + \ last" diff --git a/test/YAMLParser/spec-09-06.data b/test/YAMLParser/spec-09-06.data deleted file mode 100644 index edc0cbba900..00000000000 --- a/test/YAMLParser/spec-09-06.data +++ /dev/null @@ -1,3 +0,0 @@ -# RUN: yaml-bench -canonical %s - - 'here''s to "quotes"' diff --git a/test/YAMLParser/spec-09-06.test b/test/YAMLParser/spec-09-06.test new file mode 100644 index 00000000000..edc0cbba900 --- /dev/null +++ b/test/YAMLParser/spec-09-06.test @@ -0,0 +1,3 @@ +# RUN: yaml-bench -canonical %s + + 'here''s to "quotes"' diff --git a/test/YAMLParser/spec-09-07.data b/test/YAMLParser/spec-09-07.data deleted file mode 100644 index 3c010ca5b93..00000000000 --- a/test/YAMLParser/spec-09-07.data +++ /dev/null @@ -1,8 +0,0 @@ -# RUN: yaml-bench -canonical %s - -'simple key' : { - 'also simple' : value, - ? 'not a - simple key' : 'any - value' -} diff --git a/test/YAMLParser/spec-09-07.test b/test/YAMLParser/spec-09-07.test new file mode 100644 index 00000000000..3c010ca5b93 --- /dev/null +++ b/test/YAMLParser/spec-09-07.test @@ -0,0 +1,8 @@ +# RUN: yaml-bench -canonical %s + +'simple key' : { + 'also simple' : value, + ? 'not a + simple key' : 'any + value' +} diff --git a/test/YAMLParser/spec-09-08.data b/test/YAMLParser/spec-09-08.data deleted file mode 100644 index d114e58fcac..00000000000 --- a/test/YAMLParser/spec-09-08.data +++ /dev/null @@ -1,3 +0,0 @@ -# RUN: yaml-bench -canonical %s - - 'as space … trimmed …… specific
… none' diff --git a/test/YAMLParser/spec-09-08.test b/test/YAMLParser/spec-09-08.test new file mode 100644 index 00000000000..d114e58fcac --- /dev/null +++ b/test/YAMLParser/spec-09-08.test @@ -0,0 +1,3 @@ +# RUN: yaml-bench -canonical %s + + 'as space … trimmed …… specific
… none' diff --git a/test/YAMLParser/spec-09-09.data b/test/YAMLParser/spec-09-09.data deleted file mode 100644 index 2fec1b536ef..00000000000 --- a/test/YAMLParser/spec-09-09.data +++ /dev/null @@ -1,8 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- ' - last' -- ' - last' -- ' first - last' diff --git a/test/YAMLParser/spec-09-09.test b/test/YAMLParser/spec-09-09.test new file mode 100644 index 00000000000..2fec1b536ef --- /dev/null +++ b/test/YAMLParser/spec-09-09.test @@ -0,0 +1,8 @@ +# RUN: yaml-bench -canonical %s + +- ' + last' +- ' + last' +- ' first + last' diff --git a/test/YAMLParser/spec-09-10.data b/test/YAMLParser/spec-09-10.data deleted file mode 100644 index faabfb06b5e..00000000000 --- a/test/YAMLParser/spec-09-10.data +++ /dev/null @@ -1,5 +0,0 @@ -# RUN: yaml-bench -canonical %s - - 'first - inner - last' diff --git a/test/YAMLParser/spec-09-10.test b/test/YAMLParser/spec-09-10.test new file mode 100644 index 00000000000..faabfb06b5e --- /dev/null +++ b/test/YAMLParser/spec-09-10.test @@ -0,0 +1,5 @@ +# RUN: yaml-bench -canonical %s + + 'first + inner + last' diff --git a/test/YAMLParser/spec-09-11.data b/test/YAMLParser/spec-09-11.data deleted file mode 100644 index 3f487ad6b04..00000000000 --- a/test/YAMLParser/spec-09-11.data +++ /dev/null @@ -1,7 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- 'first - ' -- 'first - - last' diff --git a/test/YAMLParser/spec-09-11.test b/test/YAMLParser/spec-09-11.test new file mode 100644 index 00000000000..3f487ad6b04 --- /dev/null +++ b/test/YAMLParser/spec-09-11.test @@ -0,0 +1,7 @@ +# RUN: yaml-bench -canonical %s + +- 'first + ' +- 'first + + last' diff --git a/test/YAMLParser/spec-09-12.data b/test/YAMLParser/spec-09-12.data deleted file mode 100644 index d992c589cd6..00000000000 --- a/test/YAMLParser/spec-09-12.data +++ /dev/null @@ -1,10 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# Outside flow collection: -- ::std::vector -- Up, up, and away! -- -123 -# Inside flow collection: -- [ '::std::vector', - "Up, up, and away!", - -123 ] diff --git a/test/YAMLParser/spec-09-12.test b/test/YAMLParser/spec-09-12.test new file mode 100644 index 00000000000..d992c589cd6 --- /dev/null +++ b/test/YAMLParser/spec-09-12.test @@ -0,0 +1,10 @@ +# RUN: yaml-bench -canonical %s + +# Outside flow collection: +- ::std::vector +- Up, up, and away! +- -123 +# Inside flow collection: +- [ '::std::vector', + "Up, up, and away!", + -123 ] diff --git a/test/YAMLParser/spec-09-13.data b/test/YAMLParser/spec-09-13.data deleted file mode 100644 index d48f2d2c47e..00000000000 --- a/test/YAMLParser/spec-09-13.data +++ /dev/null @@ -1,8 +0,0 @@ -# RUN: yaml-bench -canonical %s - -simple key : { - also simple : value, - ? not a - simple key : any - value -} diff --git a/test/YAMLParser/spec-09-13.test b/test/YAMLParser/spec-09-13.test new file mode 100644 index 00000000000..d48f2d2c47e --- /dev/null +++ b/test/YAMLParser/spec-09-13.test @@ -0,0 +1,8 @@ +# RUN: yaml-bench -canonical %s + +simple key : { + also simple : value, + ? not a + simple key : any + value +} diff --git a/test/YAMLParser/spec-09-14.data b/test/YAMLParser/spec-09-14.data deleted file mode 100644 index a83fcd45e2c..00000000000 --- a/test/YAMLParser/spec-09-14.data +++ /dev/null @@ -1,21 +0,0 @@ -# RUN: yaml-bench -canonical %s 2>&1 | FileCheck %s -# -# Not quite sure why this doesn't fail. -# XFAIL: * - ---- ---- ||| : foo -... >>>: bar ---- -[ ---- -, -... , -{ ---- : -... # Nested -} -] -... - -# CHECK: error diff --git a/test/YAMLParser/spec-09-14.test b/test/YAMLParser/spec-09-14.test new file mode 100644 index 00000000000..55d881de433 --- /dev/null +++ b/test/YAMLParser/spec-09-14.test @@ -0,0 +1,21 @@ +# RUN: yaml-bench -canonical %s 2>&1 | FileCheck %s +# +# FIXME: This test should actually fail. Yaml bench should report an error that +# says that the '---' and '...' document start/end markers must not be specified +# as the first content line of a non-indented plain scalar. +# CHECK: !!str + +--- +--- ||| : foo +... >>>: bar +--- +[ +--- +, +... , +{ +--- : +... # Nested +} +] +... diff --git a/test/YAMLParser/spec-09-15.data b/test/YAMLParser/spec-09-15.data deleted file mode 100644 index 4111d1ba2cb..00000000000 --- a/test/YAMLParser/spec-09-15.data +++ /dev/null @@ -1,15 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- -"---" : foo -...: bar ---- -[ ----, -..., -{ -? --- -: ... -} -] -... diff --git a/test/YAMLParser/spec-09-15.test b/test/YAMLParser/spec-09-15.test new file mode 100644 index 00000000000..4111d1ba2cb --- /dev/null +++ b/test/YAMLParser/spec-09-15.test @@ -0,0 +1,15 @@ +# RUN: yaml-bench -canonical %s + +--- +"---" : foo +...: bar +--- +[ +---, +..., +{ +? --- +: ... +} +] +... diff --git a/test/YAMLParser/spec-09-16.data b/test/YAMLParser/spec-09-16.data deleted file mode 100644 index e595f47bece..00000000000 --- a/test/YAMLParser/spec-09-16.data +++ /dev/null @@ -1,5 +0,0 @@ -# RUN: yaml-bench -canonical %s - -# Tabs are confusing: -# as space/trimmed/specific/none - as space … trimmed …… specific
… none diff --git a/test/YAMLParser/spec-09-16.test b/test/YAMLParser/spec-09-16.test new file mode 100644 index 00000000000..e595f47bece --- /dev/null +++ b/test/YAMLParser/spec-09-16.test @@ -0,0 +1,5 @@ +# RUN: yaml-bench -canonical %s + +# Tabs are confusing: +# as space/trimmed/specific/none + as space … trimmed …… specific
… none diff --git a/test/YAMLParser/spec-09-17.data b/test/YAMLParser/spec-09-17.data deleted file mode 100644 index 1bacf4d68b1..00000000000 --- a/test/YAMLParser/spec-09-17.data +++ /dev/null @@ -1,5 +0,0 @@ -# RUN: yaml-bench -canonical %s - - first line - - more line diff --git a/test/YAMLParser/spec-09-17.test b/test/YAMLParser/spec-09-17.test new file mode 100644 index 00000000000..1bacf4d68b1 --- /dev/null +++ b/test/YAMLParser/spec-09-17.test @@ -0,0 +1,5 @@ +# RUN: yaml-bench -canonical %s + + first line + + more line diff --git a/test/YAMLParser/spec-09-18.data b/test/YAMLParser/spec-09-18.data deleted file mode 100644 index ac623f9973f..00000000000 --- a/test/YAMLParser/spec-09-18.data +++ /dev/null @@ -1,11 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- | # Just the style - literal -- >1 # Indentation indicator - folded -- |+ # Chomping indicator - keep - -- >-1 # Both indicators - strip diff --git a/test/YAMLParser/spec-09-18.test b/test/YAMLParser/spec-09-18.test new file mode 100644 index 00000000000..ac623f9973f --- /dev/null +++ b/test/YAMLParser/spec-09-18.test @@ -0,0 +1,11 @@ +# RUN: yaml-bench -canonical %s + +- | # Just the style + literal +- >1 # Indentation indicator + folded +- |+ # Chomping indicator + keep + +- >-1 # Both indicators + strip diff --git a/test/YAMLParser/spec-09-19.data b/test/YAMLParser/spec-09-19.data deleted file mode 100644 index 52aa157137b..00000000000 --- a/test/YAMLParser/spec-09-19.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- | - literal -- > - folded diff --git a/test/YAMLParser/spec-09-19.test b/test/YAMLParser/spec-09-19.test new file mode 100644 index 00000000000..52aa157137b --- /dev/null +++ b/test/YAMLParser/spec-09-19.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +- | + literal +- > + folded diff --git a/test/YAMLParser/spec-09-20.data b/test/YAMLParser/spec-09-20.data deleted file mode 100644 index 86fc7ab9a2e..00000000000 --- a/test/YAMLParser/spec-09-20.data +++ /dev/null @@ -1,13 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- | - detected -- > - - - # detected -- |1 - explicit -- > - - detected diff --git a/test/YAMLParser/spec-09-20.test b/test/YAMLParser/spec-09-20.test new file mode 100644 index 00000000000..86fc7ab9a2e --- /dev/null +++ b/test/YAMLParser/spec-09-20.test @@ -0,0 +1,13 @@ +# RUN: yaml-bench -canonical %s + +- | + detected +- > + + + # detected +- |1 + explicit +- > + + detected diff --git a/test/YAMLParser/spec-09-21.data b/test/YAMLParser/spec-09-21.data deleted file mode 100644 index 6eb7917a97e..00000000000 --- a/test/YAMLParser/spec-09-21.data +++ /dev/null @@ -1,12 +0,0 @@ -# RUN: yaml-bench -canonical %s 2>&1 | FileCheck %s - -- | - - text -- > - text - text -- |1 - text - -# CHECK: error diff --git a/test/YAMLParser/spec-09-21.test b/test/YAMLParser/spec-09-21.test new file mode 100644 index 00000000000..76bc7d6bd31 --- /dev/null +++ b/test/YAMLParser/spec-09-21.test @@ -0,0 +1,12 @@ +# RUN: not yaml-bench -canonical %s 2>&1 | FileCheck %s + +- | + + text +- > + text + text +- |1 + text + +# CHECK: error diff --git a/test/YAMLParser/spec-09-22.data b/test/YAMLParser/spec-09-22.data deleted file mode 100644 index b95faa50b5d..00000000000 --- a/test/YAMLParser/spec-09-22.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - -strip: |- - text
clip: | - text…keep: |+ - text
 diff --git a/test/YAMLParser/spec-09-22.test b/test/YAMLParser/spec-09-22.test new file mode 100644 index 00000000000..b95faa50b5d --- /dev/null +++ b/test/YAMLParser/spec-09-22.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +strip: |- + text
clip: | + text…keep: |+ + text
 diff --git a/test/YAMLParser/spec-09-23.data b/test/YAMLParser/spec-09-23.data deleted file mode 100644 index 94f839818b6..00000000000 --- a/test/YAMLParser/spec-09-23.data +++ /dev/null @@ -1,13 +0,0 @@ -# RUN: yaml-bench -canonical %s - - # Strip - # Comments: -strip: |- - # text
 
 # Clip - # comments: -…clip: | - # text… 
 # Keep - # comments: -…keep: |+ - # text
… # Trail - # comments. diff --git a/test/YAMLParser/spec-09-23.test b/test/YAMLParser/spec-09-23.test new file mode 100644 index 00000000000..94f839818b6 --- /dev/null +++ b/test/YAMLParser/spec-09-23.test @@ -0,0 +1,13 @@ +# RUN: yaml-bench -canonical %s + + # Strip + # Comments: +strip: |- + # text
 
 # Clip + # comments: +…clip: | + # text… 
 # Keep + # comments: +…keep: |+ + # text
… # Trail + # comments. diff --git a/test/YAMLParser/spec-09-24.data b/test/YAMLParser/spec-09-24.data deleted file mode 100644 index f08eae6a80e..00000000000 --- a/test/YAMLParser/spec-09-24.data +++ /dev/null @@ -1,8 +0,0 @@ -# RUN: yaml-bench -canonical %s - -strip: >- - -clip: > - -keep: |+ - diff --git a/test/YAMLParser/spec-09-24.test b/test/YAMLParser/spec-09-24.test new file mode 100644 index 00000000000..f08eae6a80e --- /dev/null +++ b/test/YAMLParser/spec-09-24.test @@ -0,0 +1,8 @@ +# RUN: yaml-bench -canonical %s + +strip: >- + +clip: > + +keep: |+ + diff --git a/test/YAMLParser/spec-09-25.data b/test/YAMLParser/spec-09-25.data deleted file mode 100644 index b15edb523d2..00000000000 --- a/test/YAMLParser/spec-09-25.data +++ /dev/null @@ -1,5 +0,0 @@ -# RUN: yaml-bench -canonical %s - -| # Simple block scalar - literal - text diff --git a/test/YAMLParser/spec-09-25.test b/test/YAMLParser/spec-09-25.test new file mode 100644 index 00000000000..b15edb523d2 --- /dev/null +++ b/test/YAMLParser/spec-09-25.test @@ -0,0 +1,5 @@ +# RUN: yaml-bench -canonical %s + +| # Simple block scalar + literal + text diff --git a/test/YAMLParser/spec-09-26.data b/test/YAMLParser/spec-09-26.data deleted file mode 100644 index 286740ed39c..00000000000 --- a/test/YAMLParser/spec-09-26.data +++ /dev/null @@ -1,10 +0,0 @@ -# RUN: yaml-bench -canonical %s - -| - - - literal - - text - - # Comment diff --git a/test/YAMLParser/spec-09-26.test b/test/YAMLParser/spec-09-26.test new file mode 100644 index 00000000000..286740ed39c --- /dev/null +++ b/test/YAMLParser/spec-09-26.test @@ -0,0 +1,10 @@ +# RUN: yaml-bench -canonical %s + +| + + + literal + + text + + # Comment diff --git a/test/YAMLParser/spec-09-27.data b/test/YAMLParser/spec-09-27.data deleted file mode 100644 index 286740ed39c..00000000000 --- a/test/YAMLParser/spec-09-27.data +++ /dev/null @@ -1,10 +0,0 @@ -# RUN: yaml-bench -canonical %s - -| - - - literal - - text - - # Comment diff --git a/test/YAMLParser/spec-09-27.test b/test/YAMLParser/spec-09-27.test new file mode 100644 index 00000000000..286740ed39c --- /dev/null +++ b/test/YAMLParser/spec-09-27.test @@ -0,0 +1,10 @@ +# RUN: yaml-bench -canonical %s + +| + + + literal + + text + + # Comment diff --git a/test/YAMLParser/spec-09-28.data b/test/YAMLParser/spec-09-28.data deleted file mode 100644 index 286740ed39c..00000000000 --- a/test/YAMLParser/spec-09-28.data +++ /dev/null @@ -1,10 +0,0 @@ -# RUN: yaml-bench -canonical %s - -| - - - literal - - text - - # Comment diff --git a/test/YAMLParser/spec-09-28.test b/test/YAMLParser/spec-09-28.test new file mode 100644 index 00000000000..286740ed39c --- /dev/null +++ b/test/YAMLParser/spec-09-28.test @@ -0,0 +1,10 @@ +# RUN: yaml-bench -canonical %s + +| + + + literal + + text + + # Comment diff --git a/test/YAMLParser/spec-09-29.data b/test/YAMLParser/spec-09-29.data deleted file mode 100644 index e8906ff64a1..00000000000 --- a/test/YAMLParser/spec-09-29.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - -> # Simple folded scalar - folded - text - lines diff --git a/test/YAMLParser/spec-09-29.test b/test/YAMLParser/spec-09-29.test new file mode 100644 index 00000000000..e8906ff64a1 --- /dev/null +++ b/test/YAMLParser/spec-09-29.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +> # Simple folded scalar + folded + text + lines diff --git a/test/YAMLParser/spec-09-30.data b/test/YAMLParser/spec-09-30.data deleted file mode 100644 index a2d8bf49504..00000000000 --- a/test/YAMLParser/spec-09-30.data +++ /dev/null @@ -1,16 +0,0 @@ -# RUN: yaml-bench -canonical %s - -> - folded - line - - next - line - - * bullet - * list - - last - line - -# Comment diff --git a/test/YAMLParser/spec-09-30.test b/test/YAMLParser/spec-09-30.test new file mode 100644 index 00000000000..a2d8bf49504 --- /dev/null +++ b/test/YAMLParser/spec-09-30.test @@ -0,0 +1,16 @@ +# RUN: yaml-bench -canonical %s + +> + folded + line + + next + line + + * bullet + * list + + last + line + +# Comment diff --git a/test/YAMLParser/spec-09-31.data b/test/YAMLParser/spec-09-31.data deleted file mode 100644 index a2d8bf49504..00000000000 --- a/test/YAMLParser/spec-09-31.data +++ /dev/null @@ -1,16 +0,0 @@ -# RUN: yaml-bench -canonical %s - -> - folded - line - - next - line - - * bullet - * list - - last - line - -# Comment diff --git a/test/YAMLParser/spec-09-31.test b/test/YAMLParser/spec-09-31.test new file mode 100644 index 00000000000..a2d8bf49504 --- /dev/null +++ b/test/YAMLParser/spec-09-31.test @@ -0,0 +1,16 @@ +# RUN: yaml-bench -canonical %s + +> + folded + line + + next + line + + * bullet + * list + + last + line + +# Comment diff --git a/test/YAMLParser/spec-09-32.data b/test/YAMLParser/spec-09-32.data deleted file mode 100644 index a2d8bf49504..00000000000 --- a/test/YAMLParser/spec-09-32.data +++ /dev/null @@ -1,16 +0,0 @@ -# RUN: yaml-bench -canonical %s - -> - folded - line - - next - line - - * bullet - * list - - last - line - -# Comment diff --git a/test/YAMLParser/spec-09-32.test b/test/YAMLParser/spec-09-32.test new file mode 100644 index 00000000000..a2d8bf49504 --- /dev/null +++ b/test/YAMLParser/spec-09-32.test @@ -0,0 +1,16 @@ +# RUN: yaml-bench -canonical %s + +> + folded + line + + next + line + + * bullet + * list + + last + line + +# Comment diff --git a/test/YAMLParser/spec-09-33.data b/test/YAMLParser/spec-09-33.data deleted file mode 100644 index a2d8bf49504..00000000000 --- a/test/YAMLParser/spec-09-33.data +++ /dev/null @@ -1,16 +0,0 @@ -# RUN: yaml-bench -canonical %s - -> - folded - line - - next - line - - * bullet - * list - - last - line - -# Comment diff --git a/test/YAMLParser/spec-09-33.test b/test/YAMLParser/spec-09-33.test new file mode 100644 index 00000000000..a2d8bf49504 --- /dev/null +++ b/test/YAMLParser/spec-09-33.test @@ -0,0 +1,16 @@ +# RUN: yaml-bench -canonical %s + +> + folded + line + + next + line + + * bullet + * list + + last + line + +# Comment diff --git a/test/YAMLParser/spec-10-01.data b/test/YAMLParser/spec-10-01.data deleted file mode 100644 index 549a54db42f..00000000000 --- a/test/YAMLParser/spec-10-01.data +++ /dev/null @@ -1,4 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- [ inner, inner, ] -- [inner,last] diff --git a/test/YAMLParser/spec-10-01.test b/test/YAMLParser/spec-10-01.test new file mode 100644 index 00000000000..549a54db42f --- /dev/null +++ b/test/YAMLParser/spec-10-01.test @@ -0,0 +1,4 @@ +# RUN: yaml-bench -canonical %s + +- [ inner, inner, ] +- [inner,last] diff --git a/test/YAMLParser/spec-10-02.data b/test/YAMLParser/spec-10-02.data deleted file mode 100644 index 662427a0c06..00000000000 --- a/test/YAMLParser/spec-10-02.data +++ /dev/null @@ -1,10 +0,0 @@ -# RUN: yaml-bench -canonical %s - -[ -"double - quoted", 'single - quoted', -plain - text, [ nested ], -single: pair , -] diff --git a/test/YAMLParser/spec-10-02.test b/test/YAMLParser/spec-10-02.test new file mode 100644 index 00000000000..662427a0c06 --- /dev/null +++ b/test/YAMLParser/spec-10-02.test @@ -0,0 +1,10 @@ +# RUN: yaml-bench -canonical %s + +[ +"double + quoted", 'single + quoted', +plain + text, [ nested ], +single: pair , +] diff --git a/test/YAMLParser/spec-10-03.data b/test/YAMLParser/spec-10-03.data deleted file mode 100644 index 43f300e40c3..00000000000 --- a/test/YAMLParser/spec-10-03.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - -block: # Block - # sequence -- one -- two : three diff --git a/test/YAMLParser/spec-10-03.test b/test/YAMLParser/spec-10-03.test new file mode 100644 index 00000000000..43f300e40c3 --- /dev/null +++ b/test/YAMLParser/spec-10-03.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +block: # Block + # sequence +- one +- two : three diff --git a/test/YAMLParser/spec-10-04.data b/test/YAMLParser/spec-10-04.data deleted file mode 100644 index 733a570efe8..00000000000 --- a/test/YAMLParser/spec-10-04.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - -block: -- one -- - - two diff --git a/test/YAMLParser/spec-10-04.test b/test/YAMLParser/spec-10-04.test new file mode 100644 index 00000000000..733a570efe8 --- /dev/null +++ b/test/YAMLParser/spec-10-04.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +block: +- one +- + - two diff --git a/test/YAMLParser/spec-10-05.data b/test/YAMLParser/spec-10-05.data deleted file mode 100644 index 3848b2a2006..00000000000 --- a/test/YAMLParser/spec-10-05.data +++ /dev/null @@ -1,9 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- # Empty -- | - block node -- - one # in-line - - two # sequence -- one: two # in-line - # mapping diff --git a/test/YAMLParser/spec-10-05.test b/test/YAMLParser/spec-10-05.test new file mode 100644 index 00000000000..3848b2a2006 --- /dev/null +++ b/test/YAMLParser/spec-10-05.test @@ -0,0 +1,9 @@ +# RUN: yaml-bench -canonical %s + +- # Empty +- | + block node +- - one # in-line + - two # sequence +- one: two # in-line + # mapping diff --git a/test/YAMLParser/spec-10-06.data b/test/YAMLParser/spec-10-06.data deleted file mode 100644 index 40efb2b916c..00000000000 --- a/test/YAMLParser/spec-10-06.data +++ /dev/null @@ -1,4 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- { inner : entry , also: inner , } -- {inner: entry,last : entry} diff --git a/test/YAMLParser/spec-10-06.test b/test/YAMLParser/spec-10-06.test new file mode 100644 index 00000000000..40efb2b916c --- /dev/null +++ b/test/YAMLParser/spec-10-06.test @@ -0,0 +1,4 @@ +# RUN: yaml-bench -canonical %s + +- { inner : entry , also: inner , } +- {inner: entry,last : entry} diff --git a/test/YAMLParser/spec-10-07.data b/test/YAMLParser/spec-10-07.data deleted file mode 100644 index 7aa350e40bb..00000000000 --- a/test/YAMLParser/spec-10-07.data +++ /dev/null @@ -1,9 +0,0 @@ -# RUN: yaml-bench -canonical %s - -{ -? : value, # Empty key -? explicit - key: value, -simple key : value, -[ collection, simple, key ]: value -} diff --git a/test/YAMLParser/spec-10-07.test b/test/YAMLParser/spec-10-07.test new file mode 100644 index 00000000000..7aa350e40bb --- /dev/null +++ b/test/YAMLParser/spec-10-07.test @@ -0,0 +1,9 @@ +# RUN: yaml-bench -canonical %s + +{ +? : value, # Empty key +? explicit + key: value, +simple key : value, +[ collection, simple, key ]: value +} diff --git a/test/YAMLParser/spec-10-08.data b/test/YAMLParser/spec-10-08.data deleted file mode 100644 index 53faeb9e001..00000000000 --- a/test/YAMLParser/spec-10-08.data +++ /dev/null @@ -1,13 +0,0 @@ -# RUN: yaml-bench -canonical %s 2>&1 | FileCheck %s -# -# This fails because even without a key token, some contexts (in this case flow -# maps) allow implicit null keys, which mix with this in weird ways. -# XFAIL: * - -{ -multi-line - simple key : value, -very long ...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................(>1KB)................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... key: value -} - -# CHECK: error diff --git a/test/YAMLParser/spec-10-08.test b/test/YAMLParser/spec-10-08.test new file mode 100644 index 00000000000..c4cb8e65ef2 --- /dev/null +++ b/test/YAMLParser/spec-10-08.test @@ -0,0 +1,13 @@ +# RUN: yaml-bench -canonical %s 2>&1 | FileCheck %s +# +# FIXME: This test should fail. Yaml bench should report an error that a simple +# key spans across multiple lines and that another simple key is longer than +# 1024 characters. + +{ +multi-line + simple key : value, +very long ...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................(>1KB)................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... key: value +} + +# CHECK: ? !!str "very long diff --git a/test/YAMLParser/spec-10-09.data b/test/YAMLParser/spec-10-09.data deleted file mode 100644 index a6b1fd00dde..00000000000 --- a/test/YAMLParser/spec-10-09.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - -{ -key : value, -empty: # empty value↓ -} diff --git a/test/YAMLParser/spec-10-09.test b/test/YAMLParser/spec-10-09.test new file mode 100644 index 00000000000..a6b1fd00dde --- /dev/null +++ b/test/YAMLParser/spec-10-09.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +{ +key : value, +empty: # empty value↓ +} diff --git a/test/YAMLParser/spec-10-10.data b/test/YAMLParser/spec-10-10.data deleted file mode 100644 index c97901ddfbe..00000000000 --- a/test/YAMLParser/spec-10-10.data +++ /dev/null @@ -1,10 +0,0 @@ -# RUN: yaml-bench -canonical %s - -{ -? explicit key1 : explicit value, -? explicit key2 : , # Explicit empty -? explicit key3, # Empty value -simple key1 : explicit value, -simple key2 : , # Explicit empty -simple key3, # Empty value -} diff --git a/test/YAMLParser/spec-10-10.test b/test/YAMLParser/spec-10-10.test new file mode 100644 index 00000000000..c97901ddfbe --- /dev/null +++ b/test/YAMLParser/spec-10-10.test @@ -0,0 +1,10 @@ +# RUN: yaml-bench -canonical %s + +{ +? explicit key1 : explicit value, +? explicit key2 : , # Explicit empty +? explicit key3, # Empty value +simple key1 : explicit value, +simple key2 : , # Explicit empty +simple key3, # Empty value +} diff --git a/test/YAMLParser/spec-10-11.data b/test/YAMLParser/spec-10-11.data deleted file mode 100644 index 51bd06f0202..00000000000 --- a/test/YAMLParser/spec-10-11.data +++ /dev/null @@ -1,9 +0,0 @@ -# RUN: yaml-bench -canonical %s - -[ -? explicit key1 : explicit value, -? explicit key2 : , # Explicit empty -? explicit key3, # Implicit empty -simple key1 : explicit value, -simple key2 : , # Explicit empty -] diff --git a/test/YAMLParser/spec-10-11.test b/test/YAMLParser/spec-10-11.test new file mode 100644 index 00000000000..51bd06f0202 --- /dev/null +++ b/test/YAMLParser/spec-10-11.test @@ -0,0 +1,9 @@ +# RUN: yaml-bench -canonical %s + +[ +? explicit key1 : explicit value, +? explicit key2 : , # Explicit empty +? explicit key3, # Implicit empty +simple key1 : explicit value, +simple key2 : , # Explicit empty +] diff --git a/test/YAMLParser/spec-10-12.data b/test/YAMLParser/spec-10-12.data deleted file mode 100644 index 65a90b3f2c5..00000000000 --- a/test/YAMLParser/spec-10-12.data +++ /dev/null @@ -1,5 +0,0 @@ -# RUN: yaml-bench -canonical %s - -block: # Block - # mapping - key: value diff --git a/test/YAMLParser/spec-10-12.test b/test/YAMLParser/spec-10-12.test new file mode 100644 index 00000000000..65a90b3f2c5 --- /dev/null +++ b/test/YAMLParser/spec-10-12.test @@ -0,0 +1,5 @@ +# RUN: yaml-bench -canonical %s + +block: # Block + # mapping + key: value diff --git a/test/YAMLParser/spec-10-13.data b/test/YAMLParser/spec-10-13.data deleted file mode 100644 index ccadeb1e7d5..00000000000 --- a/test/YAMLParser/spec-10-13.data +++ /dev/null @@ -1,7 +0,0 @@ -# RUN: yaml-bench -canonical %s - -? explicit key # implicit value -? | - block key -: - one # explicit in-line - - two # block value diff --git a/test/YAMLParser/spec-10-13.test b/test/YAMLParser/spec-10-13.test new file mode 100644 index 00000000000..ccadeb1e7d5 --- /dev/null +++ b/test/YAMLParser/spec-10-13.test @@ -0,0 +1,7 @@ +# RUN: yaml-bench -canonical %s + +? explicit key # implicit value +? | + block key +: - one # explicit in-line + - two # block value diff --git a/test/YAMLParser/spec-10-14.data b/test/YAMLParser/spec-10-14.data deleted file mode 100644 index 866ec1f7b2c..00000000000 --- a/test/YAMLParser/spec-10-14.data +++ /dev/null @@ -1,6 +0,0 @@ -# RUN: yaml-bench -canonical %s - -plain key: # empty value -"quoted key": -- one # explicit next-line -- two # block value diff --git a/test/YAMLParser/spec-10-14.test b/test/YAMLParser/spec-10-14.test new file mode 100644 index 00000000000..866ec1f7b2c --- /dev/null +++ b/test/YAMLParser/spec-10-14.test @@ -0,0 +1,6 @@ +# RUN: yaml-bench -canonical %s + +plain key: # empty value +"quoted key": +- one # explicit next-line +- two # block value diff --git a/test/YAMLParser/spec-10-15.data b/test/YAMLParser/spec-10-15.data deleted file mode 100644 index 7d061bddd19..00000000000 --- a/test/YAMLParser/spec-10-15.data +++ /dev/null @@ -1,5 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- sun: yellow -- ? earth: blue - : moon: white diff --git a/test/YAMLParser/spec-10-15.test b/test/YAMLParser/spec-10-15.test new file mode 100644 index 00000000000..7d061bddd19 --- /dev/null +++ b/test/YAMLParser/spec-10-15.test @@ -0,0 +1,5 @@ +# RUN: yaml-bench -canonical %s + +- sun: yellow +- ? earth: blue + : moon: white diff --git a/test/YAMLParser/str.data b/test/YAMLParser/str.data deleted file mode 100644 index bf013b6f52c..00000000000 --- a/test/YAMLParser/str.data +++ /dev/null @@ -1,3 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- abcd diff --git a/test/YAMLParser/str.test b/test/YAMLParser/str.test new file mode 100644 index 00000000000..bf013b6f52c --- /dev/null +++ b/test/YAMLParser/str.test @@ -0,0 +1,3 @@ +# RUN: yaml-bench -canonical %s + +- abcd diff --git a/test/YAMLParser/timestamp-bugs.data b/test/YAMLParser/timestamp-bugs.data deleted file mode 100644 index bf41a21b22d..00000000000 --- a/test/YAMLParser/timestamp-bugs.data +++ /dev/null @@ -1,8 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- 2001-12-14 21:59:43.10 -5:30 -- 2001-12-14 21:59:43.10 +5:30 -- 2001-12-14 21:59:43.00101 -- 2001-12-14 21:59:43+1 -- 2001-12-14 21:59:43-1:30 -- 2005-07-08 17:35:04.517600 diff --git a/test/YAMLParser/timestamp-bugs.test b/test/YAMLParser/timestamp-bugs.test new file mode 100644 index 00000000000..bf41a21b22d --- /dev/null +++ b/test/YAMLParser/timestamp-bugs.test @@ -0,0 +1,8 @@ +# RUN: yaml-bench -canonical %s + +- 2001-12-14 21:59:43.10 -5:30 +- 2001-12-14 21:59:43.10 +5:30 +- 2001-12-14 21:59:43.00101 +- 2001-12-14 21:59:43+1 +- 2001-12-14 21:59:43-1:30 +- 2005-07-08 17:35:04.517600 diff --git a/test/YAMLParser/timestamp.data b/test/YAMLParser/timestamp.data deleted file mode 100644 index 79945451b54..00000000000 --- a/test/YAMLParser/timestamp.data +++ /dev/null @@ -1,7 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- 2001-12-15T02:59:43.1Z -- 2001-12-14t21:59:43.10-05:00 -- 2001-12-14 21:59:43.10 -5 -- 2001-12-15 2:59:43.10 -- 2002-12-14 diff --git a/test/YAMLParser/timestamp.test b/test/YAMLParser/timestamp.test new file mode 100644 index 00000000000..79945451b54 --- /dev/null +++ b/test/YAMLParser/timestamp.test @@ -0,0 +1,7 @@ +# RUN: yaml-bench -canonical %s + +- 2001-12-15T02:59:43.1Z +- 2001-12-14t21:59:43.10-05:00 +- 2001-12-14 21:59:43.10 -5 +- 2001-12-15 2:59:43.10 +- 2002-12-14 diff --git a/test/YAMLParser/utf8-implicit.data b/test/YAMLParser/utf8-implicit.data deleted file mode 100644 index ee2791fb062..00000000000 --- a/test/YAMLParser/utf8-implicit.data +++ /dev/null @@ -1,3 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- implicit UTF-8 diff --git a/test/YAMLParser/utf8-implicit.test b/test/YAMLParser/utf8-implicit.test new file mode 100644 index 00000000000..ee2791fb062 --- /dev/null +++ b/test/YAMLParser/utf8-implicit.test @@ -0,0 +1,3 @@ +# RUN: yaml-bench -canonical %s + +--- implicit UTF-8 diff --git a/test/YAMLParser/utf8.data b/test/YAMLParser/utf8.data deleted file mode 100644 index 3935e9d1217..00000000000 --- a/test/YAMLParser/utf8.data +++ /dev/null @@ -1,3 +0,0 @@ -# RUN: yaml-bench -canonical %s - ---- UTF-8 diff --git a/test/YAMLParser/utf8.test b/test/YAMLParser/utf8.test new file mode 100644 index 00000000000..3935e9d1217 --- /dev/null +++ b/test/YAMLParser/utf8.test @@ -0,0 +1,3 @@ +# RUN: yaml-bench -canonical %s + +--- UTF-8 diff --git a/test/YAMLParser/value.data b/test/YAMLParser/value.data deleted file mode 100644 index 311ccd4f22e..00000000000 --- a/test/YAMLParser/value.data +++ /dev/null @@ -1,3 +0,0 @@ -# RUN: yaml-bench -canonical %s - -- = diff --git a/test/YAMLParser/value.test b/test/YAMLParser/value.test new file mode 100644 index 00000000000..311ccd4f22e --- /dev/null +++ b/test/YAMLParser/value.test @@ -0,0 +1,3 @@ +# RUN: yaml-bench -canonical %s + +- = diff --git a/test/YAMLParser/yaml.data b/test/YAMLParser/yaml.data deleted file mode 100644 index 4f9b294f456..00000000000 --- a/test/YAMLParser/yaml.data +++ /dev/null @@ -1,11 +0,0 @@ -# RUN: yaml-bench -canonical %s | FileCheck %s - -- !!yaml '!' -- !!yaml '&' -- !!yaml '*' - -# CHECK: !!seq [ -# CHECK: !!yaml "!", -# CHECK: !!yaml "&", -# CHECK: !!yaml "*", -# CHECK: ] diff --git a/test/YAMLParser/yaml.test b/test/YAMLParser/yaml.test new file mode 100644 index 00000000000..4f9b294f456 --- /dev/null +++ b/test/YAMLParser/yaml.test @@ -0,0 +1,11 @@ +# RUN: yaml-bench -canonical %s | FileCheck %s + +- !!yaml '!' +- !!yaml '&' +- !!yaml '*' + +# CHECK: !!seq [ +# CHECK: !!yaml "!", +# CHECK: !!yaml "&", +# CHECK: !!yaml "*", +# CHECK: ] diff --git a/utils/yaml-bench/YAMLBench.cpp b/utils/yaml-bench/YAMLBench.cpp index 0fb31387fc2..bd5aa152dff 100644 --- a/utils/yaml-bench/YAMLBench.cpp +++ b/utils/yaml-bench/YAMLBench.cpp @@ -19,6 +19,7 @@ #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/SourceMgr.h" #include "llvm/Support/Timer.h" +#include "llvm/Support/Process.h" #include "llvm/Support/YAMLParser.h" #include "llvm/Support/raw_ostream.h" #include @@ -52,6 +53,10 @@ static cl::opt "Do not use more megabytes of memory"), cl::init(1000)); +cl::opt + UseColor("use-color", cl::desc("Emit colored output (default=autodetect)"), + cl::init(cl::BOU_UNSET)); + struct indent { unsigned distance; indent(unsigned d) : distance(d) {} @@ -187,6 +192,9 @@ static std::string createJSONText(size_t MemoryMB, unsigned ValueSize) { int main(int argc, char **argv) { llvm::cl::ParseCommandLineOptions(argc, argv); + bool ShowColors = UseColor == cl::BOU_UNSET + ? sys::Process::StandardOutHasColors() + : UseColor == cl::BOU_TRUE; if (Input.getNumOccurrences()) { ErrorOr> BufOrErr = MemoryBuffer::getFileOrSTDIN(Input); @@ -200,8 +208,10 @@ int main(int argc, char **argv) { } if (DumpCanonical) { - yaml::Stream stream(Buf.getBuffer(), sm); + yaml::Stream stream(Buf.getBuffer(), sm, ShowColors); dumpStream(stream); + if (stream.failed()) + return 1; } }