1 namespace Test { 2 namespace Spec { 3 const char *ex2_1 = 4 "- Mark McGwire\n" 5 "- Sammy Sosa\n" 6 "- Ken Griffey"; 7 8 const char *ex2_2 = 9 "hr: 65 # Home runs\n" 10 "avg: 0.278 # Batting average\n" 11 "rbi: 147 # Runs Batted In"; 12 13 const char *ex2_3 = 14 "american:\n" 15 "- Boston Red Sox\n" 16 "- Detroit Tigers\n" 17 "- New York Yankees\n" 18 "national:\n" 19 "- New York Mets\n" 20 "- Chicago Cubs\n" 21 "- Atlanta Braves"; 22 23 const char *ex2_4 = 24 "-\n" 25 " name: Mark McGwire\n" 26 " hr: 65\n" 27 " avg: 0.278\n" 28 "-\n" 29 " name: Sammy Sosa\n" 30 " hr: 63\n" 31 " avg: 0.288"; 32 33 const char *ex2_5 = 34 "- [name , hr, avg ]\n" 35 "- [Mark McGwire, 65, 0.278]\n" 36 "- [Sammy Sosa , 63, 0.288]"; 37 38 const char *ex2_6 = 39 "Mark McGwire: {hr: 65, avg: 0.278}\n" 40 "Sammy Sosa: {\n" 41 " hr: 63,\n" 42 " avg: 0.288\n" 43 " }"; 44 45 const char *ex2_7 = 46 "# Ranking of 1998 home runs\n" 47 "---\n" 48 "- Mark McGwire\n" 49 "- Sammy Sosa\n" 50 "- Ken Griffey\n" 51 "\n" 52 "# Team ranking\n" 53 "---\n" 54 "- Chicago Cubs\n" 55 "- St Louis Cardinals"; 56 57 const char *ex2_8 = 58 "---\n" 59 "time: 20:03:20\n" 60 "player: Sammy Sosa\n" 61 "action: strike (miss)\n" 62 "...\n" 63 "---\n" 64 "time: 20:03:47\n" 65 "player: Sammy Sosa\n" 66 "action: grand slam\n" 67 "..."; 68 69 const char *ex2_9 = 70 "---\n" 71 "hr: # 1998 hr ranking\n" 72 " - Mark McGwire\n" 73 " - Sammy Sosa\n" 74 "rbi:\n" 75 " # 1998 rbi ranking\n" 76 " - Sammy Sosa\n" 77 " - Ken Griffey"; 78 79 const char *ex2_10 = 80 "---\n" 81 "hr:\n" 82 " - Mark McGwire\n" 83 " # Following node labeled SS\n" 84 " - &SS Sammy Sosa\n" 85 "rbi:\n" 86 " - *SS # Subsequent occurrence\n" 87 " - Ken Griffey"; 88 89 const char *ex2_11 = 90 "? - Detroit Tigers\n" 91 " - Chicago cubs\n" 92 ":\n" 93 " - 2001-07-23\n" 94 "\n" 95 "? [ New York Yankees,\n" 96 " Atlanta Braves ]\n" 97 ": [ 2001-07-02, 2001-08-12,\n" 98 " 2001-08-14 ]"; 99 100 const char *ex2_12 = 101 "---\n" 102 "# Products purchased\n" 103 "- item : Super Hoop\n" 104 " quantity: 1\n" 105 "- item : Basketball\n" 106 " quantity: 4\n" 107 "- item : Big Shoes\n" 108 " quantity: 1"; 109 110 const char *ex2_13 = 111 "# ASCII Art\n" 112 "--- |\n" 113 " \\//||\\/||\n" 114 " // || ||__"; 115 116 const char *ex2_14 = 117 "--- >\n" 118 " Mark McGwire's\n" 119 " year was crippled\n" 120 " by a knee injury."; 121 122 const char *ex2_15 = 123 ">\n" 124 " Sammy Sosa completed another\n" 125 " fine season with great stats.\n" 126 " \n" 127 " 63 Home Runs\n" 128 " 0.288 Batting Average\n" 129 " \n" 130 " What a year!"; 131 132 const char *ex2_16 = 133 "name: Mark McGwire\n" 134 "accomplishment: >\n" 135 " Mark set a major league\n" 136 " home run record in 1998.\n" 137 "stats: |\n" 138 " 65 Home Runs\n" 139 " 0.278 Batting Average\n"; 140 141 const char *ex2_17 = 142 "unicode: \"Sosa did fine.\\u263A\"\n" 143 "control: \"\\b1998\\t1999\\t2000\\n\"\n" 144 "hex esc: \"\\x0d\\x0a is \\r\\n\"\n" 145 "\n" 146 "single: '\"Howdy!\" he cried.'\n" 147 "quoted: ' # Not a ''comment''.'\n" 148 "tie-fighter: '|\\-*-/|'"; 149 150 const char *ex2_18 = 151 "plain:\n" 152 " This unquoted scalar\n" 153 " spans many lines.\n" 154 "\n" 155 "quoted: \"So does this\n" 156 " quoted scalar.\\n\""; 157 158 // TODO: 2.19 - 2.22 schema tags 159 160 const char *ex2_23 = 161 "---\n" 162 "not-date: !!str 2002-04-28\n" 163 "\n" 164 "picture: !!binary |\n" 165 " R0lGODlhDAAMAIQAAP//9/X\n" 166 " 17unp5WZmZgAAAOfn515eXv\n" 167 " Pz7Y6OjuDg4J+fn5OTk6enp\n" 168 " 56enmleECcgggoBADs=\n" 169 "\n" 170 "application specific tag: !something |\n" 171 " The semantics of the tag\n" 172 " above may be different for\n" 173 " different documents."; 174 175 const char *ex2_24 = 176 "%TAG ! tag:clarkevans.com,2002:\n" 177 "--- !shape\n" 178 " # Use the ! handle for presenting\n" 179 " # tag:clarkevans.com,2002:circle\n" 180 "- !circle\n" 181 " center: &ORIGIN {x: 73, y: 129}\n" 182 " radius: 7\n" 183 "- !line\n" 184 " start: *ORIGIN\n" 185 " finish: { x: 89, y: 102 }\n" 186 "- !label\n" 187 " start: *ORIGIN\n" 188 " color: 0xFFEEBB\n" 189 " text: Pretty vector drawing."; 190 191 const char *ex2_25 = 192 "# Sets are represented as a\n" 193 "# Mapping where each key is\n" 194 "# associated with a null value\n" 195 "--- !!set\n" 196 "? Mark McGwire\n" 197 "? Sammy Sosa\n" 198 "? Ken Griffey"; 199 200 const char *ex2_26 = 201 "# Ordered maps are represented as\n" 202 "# A sequence of mappings, with\n" 203 "# each mapping having one key\n" 204 "--- !!omap\n" 205 "- Mark McGwire: 65\n" 206 "- Sammy Sosa: 63\n" 207 "- Ken Griffey: 58"; 208 209 const char *ex2_27 = 210 "--- !<tag:clarkevans.com,2002:invoice>\n" 211 "invoice: 34843\n" 212 "date : 2001-01-23\n" 213 "bill-to: &id001\n" 214 " given : Chris\n" 215 " family : Dumars\n" 216 " address:\n" 217 " lines: |\n" 218 " 458 Walkman Dr.\n" 219 " Suite #292\n" 220 " city : Royal Oak\n" 221 " state : MI\n" 222 " postal : 48046\n" 223 "ship-to: *id001\n" 224 "product:\n" 225 " - sku : BL394D\n" 226 " quantity : 4\n" 227 " description : Basketball\n" 228 " price : 450.00\n" 229 " - sku : BL4438H\n" 230 " quantity : 1\n" 231 " description : Super Hoop\n" 232 " price : 2392.00\n" 233 "tax : 251.42\n" 234 "total: 4443.52\n" 235 "comments:\n" 236 " Late afternoon is best.\n" 237 " Backup contact is Nancy\n" 238 " Billsmer @ 338-4338."; 239 240 const char *ex2_28 = 241 "---\n" 242 "Time: 2001-11-23 15:01:42 -5\n" 243 "User: ed\n" 244 "Warning:\n" 245 " This is an error message\n" 246 " for the log file\n" 247 "---\n" 248 "Time: 2001-11-23 15:02:31 -5\n" 249 "User: ed\n" 250 "Warning:\n" 251 " A slightly different error\n" 252 " message.\n" 253 "---\n" 254 "Date: 2001-11-23 15:03:17 -5\n" 255 "User: ed\n" 256 "Fatal:\n" 257 " Unknown variable \"bar\"\n" 258 "Stack:\n" 259 " - file: TopClass.py\n" 260 " line: 23\n" 261 " code: |\n" 262 " x = MoreObject(\"345\\n\")\n" 263 " - file: MoreClass.py\n" 264 " line: 58\n" 265 " code: |-\n" 266 " foo = bar"; 267 268 // TODO: 5.1 - 5.2 BOM 269 270 const char *ex5_3 = 271 "sequence:\n" 272 "- one\n" 273 "- two\n" 274 "mapping:\n" 275 " ? sky\n" 276 " : blue\n" 277 " sea : green"; 278 279 const char *ex5_4 = 280 "sequence: [ one, two, ]\n" 281 "mapping: { sky: blue, sea: green }"; 282 283 const char *ex5_5 = 284 "# Comment only."; 285 286 const char *ex5_6 = 287 "anchored: !local &anchor value\n" 288 "alias: *anchor"; 289 290 const char *ex5_7 = 291 "literal: |\n" 292 " some\n" 293 " text\n" 294 "folded: >\n" 295 " some\n" 296 " text\n"; 297 298 const char *ex5_8 = 299 "single: 'text'\n" 300 "double: \"text\""; 301 302 // TODO: 5.9 directive 303 // TODO: 5.10 reserved indicator 304 305 const char *ex5_11 = 306 "|\n" 307 " Line break (no glyph)\n" 308 " Line break (glyphed)\n"; 309 310 const char *ex5_12 = 311 "# Tabs and spaces\n" 312 "quoted: \"Quoted\t\"\n" 313 "block: |\n" 314 " void main() {\n" 315 " \tprintf(\"Hello, world!\\n\");\n" 316 " }"; 317 318 const char *ex5_13 = 319 "\"Fun with \\\\\n" 320 "\\\" \\a \\b \\e \\f \\\n" 321 "\\n \\r \\t \\v \\0 \\\n" 322 "\\ \\_ \\N \\L \\P \\\n" 323 "\\x41 \\u0041 \\U00000041\""; 324 325 const char *ex5_14 = 326 "Bad escapes:\n" 327 " \"\\c\n" 328 " \\xq-\""; 329 330 const char *ex6_1 = 331 " # Leading comment line spaces are\n" 332 " # neither content nor indentation.\n" 333 " \n" 334 "Not indented:\n" 335 " By one space: |\n" 336 " By four\n" 337 " spaces\n" 338 " Flow style: [ # Leading spaces\n" 339 " By two, # in flow style\n" 340 " Also by two, # are neither\n" 341 " \tStill by two # content nor\n" 342 " ] # indentation."; 343 344 const char *ex6_2 = 345 "? a\n" 346 ": -\tb\n" 347 " - -\tc\n" 348 " - d"; 349 350 const char *ex6_3 = 351 "- foo:\t bar\n" 352 "- - baz\n" 353 " -\tbaz"; 354 355 const char *ex6_4 = 356 "plain: text\n" 357 " lines\n" 358 "quoted: \"text\n" 359 " \tlines\"\n" 360 "block: |\n" 361 " text\n" 362 " \tlines\n"; 363 364 const char *ex6_5 = 365 "Folding:\n" 366 " \"Empty line\n" 367 " \t\n" 368 " as a line feed\"\n" 369 "Chomping: |\n" 370 " Clipped empty lines\n" 371 " "; 372 373 const char *ex6_6 = 374 ">-\n" 375 " trimmed\n" 376 " \n" 377 " \n" 378 "\n" 379 " as\n" 380 " space"; 381 382 const char *ex6_7 = 383 ">\n" 384 " foo \n" 385 " \n" 386 " \t bar\n" 387 "\n" 388 " baz\n"; 389 390 const char *ex6_8 = 391 "\"\n" 392 " foo \n" 393 " \n" 394 " \t bar\n" 395 "\n" 396 " baz\n" 397 "\""; 398 399 const char *ex6_9 = 400 "key: # Comment\n" 401 " value"; 402 403 const char *ex6_10 = 404 " # Comment\n" 405 " \n" 406 "\n"; 407 408 const char *ex6_11 = 409 "key: # Comment\n" 410 " # lines\n" 411 " value\n" 412 "\n"; 413 414 const char *ex6_12 = 415 "{ first: Sammy, last: Sosa }:\n" 416 "# Statistics:\n" 417 " hr: # Home runs\n" 418 " 65\n" 419 " avg: # Average\n" 420 " 0.278"; 421 422 const char *ex6_13 = 423 "%FOO bar baz # Should be ignored\n" 424 " # with a warning.\n" 425 "--- \"foo\""; 426 427 const char *ex6_14 = 428 "%YAML 1.3 # Attempt parsing\n" 429 " # with a warning\n" 430 "---\n" 431 "\"foo\""; 432 433 const char *ex6_15 = 434 "%YAML 1.2\n" 435 "%YAML 1.1\n" 436 "foo"; 437 438 const char *ex6_16 = 439 "%TAG !yaml! tag:yaml.org,2002:\n" 440 "---\n" 441 "!yaml!str \"foo\""; 442 443 const char *ex6_17 = 444 "%TAG ! !foo\n" 445 "%TAG ! !foo\n" 446 "bar"; 447 448 const char *ex6_18 = 449 "# Private\n" 450 "!foo \"bar\"\n" 451 "...\n" 452 "# Global\n" 453 "%TAG ! tag:example.com,2000:app/\n" 454 "---\n" 455 "!foo \"bar\""; 456 457 const char *ex6_19 = 458 "%TAG !! tag:example.com,2000:app/\n" 459 "---\n" 460 "!!int 1 - 3 # Interval, not integer"; 461 462 const char *ex6_20 = 463 "%TAG !e! tag:example.com,2000:app/\n" 464 "---\n" 465 "!e!foo \"bar\""; 466 467 const char *ex6_21 = 468 "%TAG !m! !my-\n" 469 "--- # Bulb here\n" 470 "!m!light fluorescent\n" 471 "...\n" 472 "%TAG !m! !my-\n" 473 "--- # Color here\n" 474 "!m!light green"; 475 476 const char *ex6_22 = 477 "%TAG !e! tag:example.com,2000:app/\n" 478 "---\n" 479 "- !e!foo \"bar\""; 480 481 const char *ex6_23 = 482 "!!str &a1 \"foo\":\n" 483 " !!str bar\n" 484 "&a2 baz : *a1"; 485 486 const char *ex6_24 = 487 "!<tag:yaml.org,2002:str> foo :\n" 488 " !<!bar> baz"; 489 490 const char *ex6_25 = 491 "- !<!> foo\n" 492 "- !<$:?> bar\n"; 493 494 const char *ex6_26 = 495 "%TAG !e! tag:example.com,2000:app/\n" 496 "---\n" 497 "- !local foo\n" 498 "- !!str bar\n" 499 "- !e!tag%21 baz\n"; 500 501 const char *ex6_27a = 502 "%TAG !e! tag:example,2000:app/\n" 503 "---\n" 504 "- !e! foo"; 505 506 const char *ex6_27b = 507 "%TAG !e! tag:example,2000:app/\n" 508 "---\n" 509 "- !h!bar baz"; 510 511 const char *ex6_28 = 512 "# Assuming conventional resolution:\n" 513 "- \"12\"\n" 514 "- 12\n" 515 "- ! 12"; 516 517 const char *ex6_29 = 518 "First occurrence: &anchor Value\n" 519 "Second occurrence: *anchor"; 520 521 const char *ex7_1 = 522 "First occurrence: &anchor Foo\n" 523 "Second occurrence: *anchor\n" 524 "Override anchor: &anchor Bar\n" 525 "Reuse anchor: *anchor"; 526 527 const char *ex7_2 = 528 "{\n" 529 " foo : !!str,\n" 530 " !!str : bar,\n" 531 "}"; 532 533 const char *ex7_3 = 534 "{\n" 535 " ? foo :,\n" 536 " : bar,\n" 537 "}\n"; 538 539 const char *ex7_4 = 540 "\"implicit block key\" : [\n" 541 " \"implicit flow key\" : value,\n" 542 " ]"; 543 544 const char *ex7_5 = 545 "\"folded \n" 546 "to a space,\t\n" 547 " \n" 548 "to a line feed, or \t\\\n" 549 " \\ \tnon-content\""; 550 551 const char *ex7_6 = 552 "\" 1st non-empty\n" 553 "\n" 554 " 2nd non-empty \n" 555 "\t3rd non-empty \""; 556 557 const char *ex7_7 = 558 " 'here''s to \"quotes\"'"; 559 560 const char *ex7_8 = 561 "'implicit block key' : [\n" 562 " 'implicit flow key' : value,\n" 563 " ]"; 564 565 const char *ex7_9 = 566 "' 1st non-empty\n" 567 "\n" 568 " 2nd non-empty \n" 569 "\t3rd non-empty '"; 570 571 const char *ex7_10 = 572 "# Outside flow collection:\n" 573 "- ::vector\n" 574 "- \": - ()\"\n" 575 "- Up, up, and away!\n" 576 "- -123\n" 577 "- http://example.com/foo#bar\n" 578 "# Inside flow collection:\n" 579 "- [ ::vector,\n" 580 " \": - ()\",\n" 581 " \"Up, up, and away!\",\n" 582 " -123,\n" 583 " http://example.com/foo#bar ]"; 584 585 const char *ex7_11 = 586 "implicit block key : [\n" 587 " implicit flow key : value,\n" 588 " ]"; 589 590 const char *ex7_12 = 591 "1st non-empty\n" 592 "\n" 593 " 2nd non-empty \n" 594 "\t3rd non-empty"; 595 596 const char *ex7_13 = 597 "- [ one, two, ]\n" 598 "- [three ,four]"; 599 600 const char *ex7_14 = 601 "[\n" 602 "\"double\n" 603 " quoted\", 'single\n" 604 " quoted',\n" 605 "plain\n" 606 " text, [ nested ],\n" 607 "single: pair,\n" 608 "]"; 609 610 const char *ex7_15 = 611 "- { one : two , three: four , }\n" 612 "- {five: six,seven : eight}"; 613 614 const char *ex7_16 = 615 "{\n" 616 "? explicit: entry,\n" 617 "implicit: entry,\n" 618 "?\n" 619 "}"; 620 621 const char *ex7_17 = 622 "{\n" 623 "unquoted : \"separate\",\n" 624 "http://foo.com,\n" 625 "omitted value:,\n" 626 ": omitted key,\n" 627 "}"; 628 629 const char *ex7_18 = 630 "{\n" 631 "\"adjacent\":value,\n" 632 "\"readable\":value,\n" 633 "\"empty\":\n" 634 "}"; 635 636 const char *ex7_19 = 637 "[\n" 638 "foo: bar\n" 639 "]"; 640 641 const char *ex7_20 = 642 "[\n" 643 "? foo\n" 644 " bar : baz\n" 645 "]"; 646 647 const char *ex7_21 = 648 "- [ YAML : separate ]\n" 649 "- [ : empty key entry ]\n" 650 "- [ {JSON: like}:adjacent ]"; 651 652 const char *ex7_22 = 653 "[ foo\n" 654 " bar: invalid,"; // Note: we don't check (on purpose) the >1K chars for an implicit key 655 656 const char *ex7_23 = 657 "- [ a, b ]\n" 658 "- { a: b }\n" 659 "- \"a\"\n" 660 "- 'b'\n" 661 "- c"; 662 663 const char *ex7_24 = 664 "- !!str \"a\"\n" 665 "- 'b'\n" 666 "- &anchor \"c\"\n" 667 "- *anchor\n" 668 "- !!str"; 669 670 const char *ex8_1 = 671 "- | # Empty header\n" 672 " literal\n" 673 "- >1 # Indentation indicator\n" 674 " folded\n" 675 "- |+ # Chomping indicator\n" 676 " keep\n" 677 "\n" 678 "- >1- # Both indicators\n" 679 " strip\n"; 680 681 const char *ex8_2 = 682 "- |\n" 683 " detected\n" 684 "- >\n" 685 " \n" 686 " \n" 687 " # detected\n" 688 "- |1\n" 689 " explicit\n" 690 "- >\n" 691 " \t\n" 692 " detected\n"; 693 694 const char *ex8_3a = 695 "- |\n" 696 " \n" 697 " text"; 698 699 const char *ex8_3b = 700 "- >\n" 701 " text\n" 702 " text"; 703 704 const char *ex8_3c = 705 "- |2\n" 706 " text"; 707 708 const char *ex8_4 = 709 "strip: |-\n" 710 " text\n" 711 "clip: |\n" 712 " text\n" 713 "keep: |+\n" 714 " text\n"; 715 716 const char *ex8_5 = 717 " # Strip\n" 718 " # Comments:\n" 719 "strip: |-\n" 720 " # text\n" 721 " \n" 722 " # Clip\n" 723 " # comments:\n" 724 "\n" 725 "clip: |\n" 726 " # text\n" 727 " \n" 728 " # Keep\n" 729 " # comments:\n" 730 "\n" 731 "keep: |+\n" 732 " # text\n" 733 "\n" 734 " # Trail\n" 735 " # Comments\n"; 736 737 const char *ex8_6 = 738 "strip: >-\n" 739 "\n" 740 "clip: >\n" 741 "\n" 742 "keep: |+\n" 743 "\n"; 744 745 const char *ex8_7 = 746 "|\n" 747 " literal\n" 748 " \ttext\n" 749 "\n"; 750 751 const char *ex8_8 = 752 "|\n" 753 " \n" 754 " \n" 755 " literal\n" 756 " \n" 757 " \n" 758 " text\n" 759 "\n" 760 " # Comment\n"; 761 762 const char *ex8_9 = 763 ">\n" 764 " folded\n" 765 " text\n" 766 "\n"; 767 768 const char *ex8_10 = 769 ">\n" 770 "\n" 771 " folded\n" 772 " line\n" 773 "\n" 774 " next\n" 775 " line\n" 776 " * bullet\n" 777 "\n" 778 " * list\n" 779 " * lines\n" 780 "\n" 781 " last\n" 782 " line\n" 783 "\n" 784 "# Comment\n"; 785 786 const char *ex8_11 = ex8_10; 787 const char *ex8_12 = ex8_10; 788 const char *ex8_13 = ex8_10; 789 790 const char *ex8_14 = 791 "block sequence:\n" 792 " - one\n" 793 " - two : three\n"; 794 795 const char *ex8_15 = 796 "- # Empty\n" 797 "- |\n" 798 " block node\n" 799 "- - one # Compact\n" 800 " - two # sequence\n" 801 "- one: two # Compact mapping\n"; 802 803 const char *ex8_16 = 804 "block mapping:\n" 805 " key: value\n"; 806 807 const char *ex8_17 = 808 "? explicit key # Empty value\n" 809 "? |\n" 810 " block key\n" 811 ": - one # Explicit compact\n" 812 " - two # block value\n"; 813 814 const char *ex8_18 = 815 "plain key: in-line value\n" 816 ": # Both empty\n" 817 "\"quoted key\":\n" 818 "- entry\n"; 819 820 const char *ex8_19 = 821 "- sun: yellow\n" 822 "- ? earth: blue\n" 823 " : moon: white\n"; 824 825 const char *ex8_20 = 826 "-\n" 827 " \"flow in block\"\n" 828 "- >\n" 829 " Block scalar\n" 830 "- !!map # Block collection\n" 831 " foo : bar\n"; 832 833 const char *ex8_21 = 834 "literal: |2\n" 835 " value\n" 836 "folded:\n" 837 " !foo\n" 838 " >1\n" 839 " value\n"; 840 841 const char *ex8_22 = 842 "sequence: !!seq\n" 843 "- entry\n" 844 "- !!seq\n" 845 " - nested\n" 846 "mapping: !!map\n" 847 " foo: bar\n"; 848 } 849 } 850 851