| | 208 | |
| | 209 | /** |
| | 210 | * @ticket 22692 |
| | 211 | */ |
| | 212 | function test_spaces_around_quotes() { |
| | 213 | $nbsp = "\xC2\xA0"; |
| | 214 | $pi = "\xCE\xA0"; |
| | 215 | |
| | 216 | // This should never happen, even if the desired output changes some day. |
| | 217 | |
| | 218 | $problem_input = "$nbsp\"A"; |
| | 219 | $problem_output = "$nbsp”A"; |
| | 220 | |
| | 221 | $this->assertNotEquals( $problem_output, wptexturize( $problem_input ) ); |
| | 222 | |
| | 223 | // These are desirable outputs for the current design. |
| | 224 | |
| | 225 | $input = array(); |
| | 226 | $output = array(); |
| | 227 | |
| | 228 | $input[] = "stop. $nbsp\"A quote after 2 spaces.\""; |
| | 229 | $output[] = "stop. $nbsp“A quote after 2 spaces.”"; |
| | 230 | |
| | 231 | $input[] = "stop.$nbsp$nbsp\"A quote after 2 spaces.\""; |
| | 232 | $output[] = "stop.$nbsp$nbsp“A quote after 2 spaces.”"; |
| | 233 | |
| | 234 | $input[] = "stop. $nbsp'A quote after 2 spaces.'"; |
| | 235 | $output[] = "stop. $nbsp‘A quote after 2 spaces.’"; |
| | 236 | |
| | 237 | $input[] = "stop.$nbsp$nbsp'A quote after 2 spaces.'"; |
| | 238 | $output[] = "stop.$nbsp$nbsp‘A quote after 2 spaces.’"; |
| | 239 | |
| | 240 | $input[] = "stop. \"A quote after 2 spaces.\""; |
| | 241 | $output[] = "stop. “A quote after 2 spaces.”"; |
| | 242 | |
| | 243 | $input[] = "stop. \"A quote after 2 spaces.\""; |
| | 244 | $output[] = "stop. “A quote after 2 spaces.”"; |
| | 245 | |
| | 246 | $input[] = "stop. 'A quote after 2 spaces.'"; |
| | 247 | $output[] = "stop. ‘A quote after 2 spaces.’"; |
| | 248 | |
| | 249 | $input[] = "stop. 'A quote after 2 spaces.'"; |
| | 250 | $output[] = "stop. ‘A quote after 2 spaces.’"; |
| | 251 | |
| | 252 | $input[] = "Contraction: $pi's"; |
| | 253 | $output[] = "Contraction: $pi’s"; |
| | 254 | |
| | 255 | foreach($input as $key => $in) { |
| | 256 | $this->assertEquals( $output[$key], wptexturize( $in ) ); |
| | 257 | } |
| | 258 | } |
| | 259 | |
| | 260 | /** |
| | 261 | * Check all baseline patterns. If anything ever changes in wptexturize(), these tests may fail. |
| | 262 | * |
| | 263 | * @ticket 22692 |
| | 264 | */ |
| | 265 | function test_all_regexp_behaviors() { |
| | 266 | $input = array(); |
| | 267 | $output = array(); |
| | 268 | |
| | 269 | // Apostrophe before a number always becomes ’ (apos); |
| | 270 | |
| | 271 | $input[] = "word '99 word"; |
| | 272 | $output[] = "word ’99 word"; |
| | 273 | |
| | 274 | $input[] = "word'99 word"; |
| | 275 | $output[] = "word’99 word"; |
| | 276 | |
| | 277 | $input[] = "word '99word"; |
| | 278 | $output[] = "word ’99word"; |
| | 279 | |
| | 280 | $input[] = "word'99word"; |
| | 281 | $output[] = "word’99word"; |
| | 282 | |
| | 283 | $input[] = "word '99’s word"; // Appears as a separate but logically superfluous pattern in 3.8. |
| | 284 | $output[] = "word ’99’s word"; |
| | 285 | |
| | 286 | $input[] = "word '99's word"; // Due to the logic error, second apos becomes a prime. See ticket #22823 |
| | 287 | $output[] = "word ’99′s word"; |
| | 288 | |
| | 289 | $input[] = "word '99'samsonite"; |
| | 290 | $output[] = "word ’99′samsonite"; |
| | 291 | |
| | 292 | $input[] = "according to our source, '33% of all students scored less than 50' on the test."; // Apostrophes and primes have priority over quotes |
| | 293 | $output[] = "according to our source, ’33% of all students scored less than 50′ on the test."; |
| | 294 | |
| | 295 | $input[] = "word '99' word"; // See ticket #8775 |
| | 296 | $output[] = "word ’99′ word"; |
| | 297 | |
| | 298 | // Apostrophe after a space or ([{<" becomes ‘ (opening_single_quote) |
| | 299 | |
| | 300 | $input[] = "word 'word word"; |
| | 301 | $output[] = "word ‘word word"; |
| | 302 | |
| | 303 | $input[] = "word ('word word"; |
| | 304 | $output[] = "word (‘word word"; |
| | 305 | |
| | 306 | $input[] = "word ['word word"; |
| | 307 | $output[] = "word [‘word word"; |
| | 308 | |
| | 309 | $input[] = "word <'word word"; // Invalid HTML input? |
| | 310 | $output[] = "word <‘word word"; |
| | 311 | |
| | 312 | $input[] = "word <'word word"; // Valid HTML input triggers the apos in a word pattern |
| | 313 | $output[] = "word <’word word"; |
| | 314 | |
| | 315 | $input[] = "word {'word word"; |
| | 316 | $output[] = "word {‘word word"; |
| | 317 | |
| | 318 | $input[] = "word \"'word word"; |
| | 319 | $output[] = "word “‘word word"; // Two opening quotes |
| | 320 | |
| | 321 | $input[] = "'word word"; |
| | 322 | $output[] = "‘word word"; |
| | 323 | |
| | 324 | $input[] = "word('word word"; |
| | 325 | $output[] = "word(‘word word"; |
| | 326 | |
| | 327 | $input[] = "word['word word"; |
| | 328 | $output[] = "word[‘word word"; |
| | 329 | |
| | 330 | $input[] = "word<'word word"; |
| | 331 | $output[] = "word<‘word word"; |
| | 332 | |
| | 333 | $input[] = "word<'word word"; |
| | 334 | $output[] = "word<’word word"; |
| | 335 | |
| | 336 | $input[] = "word{'word word"; |
| | 337 | $output[] = "word{‘word word"; |
| | 338 | |
| | 339 | $input[] = "word\"'word word"; |
| | 340 | $output[] = "word”‘word word"; // Closing quote, then opening quote |
| | 341 | |
| | 342 | $input[] = "word ' word word"; |
| | 343 | $output[] = "word ‘ word word"; |
| | 344 | |
| | 345 | $input[] = "word (' word word"; |
| | 346 | $output[] = "word (‘ word word"; |
| | 347 | |
| | 348 | $input[] = "word [' word word"; |
| | 349 | $output[] = "word [‘ word word"; |
| | 350 | |
| | 351 | $input[] = "word <' word word"; // Invalid HTML input? |
| | 352 | $output[] = "word <‘ word word"; |
| | 353 | |
| | 354 | $input[] = "word <' word word"; // Valid HTML input triggers the closing single quote here |
| | 355 | $output[] = "word <’ word word"; |
| | 356 | |
| | 357 | $input[] = "word {' word word"; |
| | 358 | $output[] = "word {‘ word word"; |
| | 359 | |
| | 360 | $input[] = "word \"' word word"; |
| | 361 | $output[] = "word “‘ word word"; // Two opening quotes |
| | 362 | |
| | 363 | $input[] = "' word word"; |
| | 364 | $output[] = "‘ word word"; |
| | 365 | |
| | 366 | $input[] = "word(' word word"; |
| | 367 | $output[] = "word(‘ word word"; |
| | 368 | |
| | 369 | $input[] = "word[' word word"; |
| | 370 | $output[] = "word[‘ word word"; |
| | 371 | |
| | 372 | $input[] = "word<' word word"; |
| | 373 | $output[] = "word<‘ word word"; |
| | 374 | |
| | 375 | $input[] = "word<' word word"; |
| | 376 | $output[] = "word<’ word word"; |
| | 377 | |
| | 378 | $input[] = "word{' word word"; |
| | 379 | $output[] = "word{‘ word word"; |
| | 380 | |
| | 381 | $input[] = "word\"' word word"; |
| | 382 | $output[] = "word”‘ word word"; // Closing quote, then opening quote |
| | 383 | |
| | 384 | // Double quote after a number becomes ″ (double_prime) |
| | 385 | |
| | 386 | $input[] = 'word 99" word'; |
| | 387 | $output[] = 'word 99″ word'; |
| | 388 | |
| | 389 | $input[] = 'word 99"word'; |
| | 390 | $output[] = 'word 99″word'; |
| | 391 | |
| | 392 | $input[] = 'word99" word'; |
| | 393 | $output[] = 'word99″ word'; |
| | 394 | |
| | 395 | $input[] = 'word99"word'; |
| | 396 | $output[] = 'word99″word'; |
| | 397 | |
| | 398 | // Apostrophe after a number becomes ′ (prime) |
| | 399 | |
| | 400 | $input[] = "word 99' word"; |
| | 401 | $output[] = "word 99′ word"; |
| | 402 | |
| | 403 | $input[] = "word 99'word"; |
| | 404 | $output[] = "word 99′word"; |
| | 405 | |
| | 406 | $input[] = "word99' word"; |
| | 407 | $output[] = "word99′ word"; |
| | 408 | |
| | 409 | $input[] = "word99'word"; |
| | 410 | $output[] = "word99′word"; |
| | 411 | |
| | 412 | // Apostrophe "in a word" becomes ’ (apos) |
| | 413 | |
| | 414 | $input[] = "word word's word"; |
| | 415 | $output[] = "word word’s word"; |
| | 416 | |
| | 417 | $input[] = "word word'. word"; // Quotes with outside punctuation could end with apostrophes instead of closing quotes (may affect i18n) |
| | 418 | $output[] = "word word’. word"; |
| | 419 | |
| | 420 | $input[] = "word ]'. word"; |
| | 421 | $output[] = "word ]’. word"; |
| | 422 | |
| | 423 | $input[] = "word )'. word"; |
| | 424 | $output[] = "word )’. word"; |
| | 425 | |
| | 426 | $input[] = "word }'. word"; |
| | 427 | $output[] = "word }’. word"; |
| | 428 | |
| | 429 | $input[] = "word >'. word"; // Not tested |
| | 430 | $output[] = "word >’. word"; |
| | 431 | |
| | 432 | $input[] = "word >'. word"; |
| | 433 | $output[] = "word >’. word"; |
| | 434 | |
| | 435 | // Double quote after a space or ([{< becomes “ (opening_quote) if not followed by spaces |
| | 436 | |
| | 437 | $input[] = 'word "word word'; |
| | 438 | $output[] = 'word “word word'; |
| | 439 | |
| | 440 | $input[] = 'word ("word word'; |
| | 441 | $output[] = 'word (“word word'; |
| | 442 | |
| | 443 | $input[] = 'word ["word word'; |
| | 444 | $output[] = 'word [“word word'; |
| | 445 | |
| | 446 | $input[] = 'word <"word word'; // Invalid HTML input? |
| | 447 | $output[] = 'word <“word word'; |
| | 448 | |
| | 449 | $input[] = 'word <"word word'; // Valid HTML input triggers the closing quote pattern |
| | 450 | $output[] = 'word <”word word'; |
| | 451 | |
| | 452 | $input[] = 'word {"word word'; |
| | 453 | $output[] = 'word {“word word'; |
| | 454 | |
| | 455 | $input[] = '"word word'; |
| | 456 | $output[] = '“word word'; |
| | 457 | |
| | 458 | $input[] = 'word("word word'; |
| | 459 | $output[] = 'word(“word word'; |
| | 460 | |
| | 461 | $input[] = 'word["word word'; |
| | 462 | $output[] = 'word[“word word'; |
| | 463 | |
| | 464 | $input[] = 'word<"word word'; // Invalid HTML input? |
| | 465 | $output[] = 'word<“word word'; |
| | 466 | |
| | 467 | $input[] = 'word<"word word'; // Valid HTML input triggers the closing quote pattern |
| | 468 | $output[] = 'word<”word word'; |
| | 469 | |
| | 470 | $input[] = 'word{"word word'; |
| | 471 | $output[] = 'word{“word word'; |
| | 472 | |
| | 473 | $input[] = 'word "99 word'; |
| | 474 | $output[] = 'word “99 word'; |
| | 475 | |
| | 476 | // Double quote becomes ” (closing_quote) unless it is already converted to double_prime or opening_quote. |
| | 477 | |
| | 478 | $input[] = 'word word" word'; |
| | 479 | $output[] = 'word word” word'; |
| | 480 | |
| | 481 | $input[] = 'word word") word'; |
| | 482 | $output[] = 'word word”) word'; |
| | 483 | |
| | 484 | $input[] = 'word word"] word'; |
| | 485 | $output[] = 'word word”] word'; |
| | 486 | |
| | 487 | $input[] = 'word word"} word'; |
| | 488 | $output[] = 'word word”} word'; |
| | 489 | |
| | 490 | $input[] = 'word word"> word'; // Invalid HTML input? |
| | 491 | $output[] = 'word word”> word'; |
| | 492 | |
| | 493 | $input[] = 'word word"> word'; // Valid HTML should work |
| | 494 | $output[] = 'word word”> word'; |
| | 495 | |
| | 496 | $input[] = 'word word"'; |
| | 497 | $output[] = 'word word”'; |
| | 498 | |
| | 499 | $input[] = 'word word"word'; |
| | 500 | $output[] = 'word word”word'; |
| | 501 | |
| | 502 | $input[] = 'word"word"word'; |
| | 503 | $output[] = 'word”word”word'; |
| | 504 | |
| | 505 | $input[] = 'test sentence".'; |
| | 506 | $output[] = 'test sentence”.'; |
| | 507 | |
| | 508 | $input[] = 'test sentence."'; |
| | 509 | $output[] = 'test sentence.”'; |
| | 510 | |
| | 511 | $input[] = 'test sentence". word'; |
| | 512 | $output[] = 'test sentence”. word'; |
| | 513 | |
| | 514 | $input[] = 'test sentence." word'; |
| | 515 | $output[] = 'test sentence.” word'; |
| | 516 | |
| | 517 | // Single quote followed by a space or a period becomes ’ (closing_single_quote) |
| | 518 | |
| | 519 | $input[] = "word word' word"; |
| | 520 | $output[] = "word word’ word"; |
| | 521 | |
| | 522 | $input[] = "word word'. word"; |
| | 523 | $output[] = "word word’. word"; |
| | 524 | |
| | 525 | $input[] = "word word'.word"; |
| | 526 | $output[] = "word word’.word"; |
| | 527 | |
| | 528 | $input[] = "word word'"; |
| | 529 | $output[] = "word word’"; |
| | 530 | |
| | 531 | $input[] = "test sentence'."; |
| | 532 | $output[] = "test sentence’."; |
| | 533 | |
| | 534 | $input[] = "test sentence.'"; |
| | 535 | $output[] = "test sentence.’"; |
| | 536 | |
| | 537 | $input[] = "test sentence'. word"; |
| | 538 | $output[] = "test sentence’. word"; |
| | 539 | |
| | 540 | $input[] = "test sentence.' word"; |
| | 541 | $output[] = "test sentence.’ word"; |
| | 542 | |
| | 543 | // 9x9 becomes 9×9 |
| | 544 | |
| | 545 | $input[] = "9x9"; |
| | 546 | $output[] = "9×9"; |
| | 547 | |
| | 548 | $input[] = "12x34"; |
| | 549 | $output[] = "12×34"; |
| | 550 | |
| | 551 | $input[] = "9 x 9"; |
| | 552 | $output[] = "9 x 9"; |
| | 553 | |
| | 554 | // & always becomes & unless it is followed by # or ; |
| | 555 | |
| | 556 | $input[] = "word & word"; |
| | 557 | $output[] = "word & word"; |
| | 558 | |
| | 559 | $input[] = "word&word"; |
| | 560 | $output[] = "word&word"; |
| | 561 | |
| | 562 | $input[] = "word word"; |
| | 563 | $output[] = "word word"; |
| | 564 | |
| | 565 | $input[] = "word & word"; |
| | 566 | $output[] = "word & word"; |
| | 567 | |
| | 568 | $input[] = "word &# word"; |
| | 569 | $output[] = "word &# word"; // invalid output? |
| | 570 | |
| | 571 | $input[] = "word &44; word"; |
| | 572 | $output[] = "word &44; word"; |
| | 573 | |
| | 574 | |
| | 575 | foreach($input as $key => $in) { |
| | 576 | $this->assertEquals( $output[$key], wptexturize( $in ) ); |
| | 577 | } |
| | 578 | } |
| | 579 | |
| | 580 | |
| | 581 | |
| | 582 | /** |
| | 583 | * Check all baseline patterns. If anything ever changes in wptexturize(), these tests may fail. |
| | 584 | * |
| | 585 | * @ticket 22692 |
| | 586 | */ |
| | 587 | function test_all_static_behaviors() { |
| | 588 | $input = array(); |
| | 589 | $output = array(); |
| | 590 | |
| | 591 | // "cockney" phrases begin with apos instead of opening_single_quote. |
| | 592 | |
| | 593 | $input[] = "word 'tain't word"; |
| | 594 | $output[] = "word ’tain’t word"; |
| | 595 | |
| | 596 | $input[] = "word 'twere word"; |
| | 597 | $output[] = "word ’twere word"; |
| | 598 | |
| | 599 | $input[] = "word 'twas word"; |
| | 600 | $output[] = "word ’twas word"; |
| | 601 | |
| | 602 | $input[] = "word 'tis word"; |
| | 603 | $output[] = "word ’tis word"; |
| | 604 | |
| | 605 | $input[] = "word 'twill word"; |
| | 606 | $output[] = "word ’twill word"; |
| | 607 | |
| | 608 | $input[] = "word 'til word"; |
| | 609 | $output[] = "word ’til word"; |
| | 610 | |
| | 611 | $input[] = "word 'bout word"; |
| | 612 | $output[] = "word ’bout word"; |
| | 613 | |
| | 614 | $input[] = "word 'nuff word"; |
| | 615 | $output[] = "word ’nuff word"; |
| | 616 | |
| | 617 | $input[] = "word 'round word"; |
| | 618 | $output[] = "word ’round word"; |
| | 619 | |
| | 620 | $input[] = "word 'cause word"; |
| | 621 | $output[] = "word ’cause word"; |
| | 622 | |
| | 623 | $input[] = "word 'em word"; |
| | 624 | $output[] = "word ‘em word"; |
| | 625 | |
| | 626 | // Smart dashes, etc |
| | 627 | |
| | 628 | $input[] = "word --- word"; |
| | 629 | $output[] = "word — word"; |
| | 630 | |
| | 631 | $input[] = "word---word"; |
| | 632 | $output[] = "word—word"; |
| | 633 | |
| | 634 | $input[] = "word -- word"; |
| | 635 | $output[] = "word — word"; |
| | 636 | |
| | 637 | $input[] = "word--word"; |
| | 638 | $output[] = "word–word"; |
| | 639 | |
| | 640 | $input[] = "word - word"; |
| | 641 | $output[] = "word – word"; |
| | 642 | |
| | 643 | $input[] = "word-word"; |
| | 644 | $output[] = "word-word"; |
| | 645 | |
| | 646 | $input[] = "word xn– word"; |
| | 647 | $output[] = "word xn-- word"; |
| | 648 | |
| | 649 | $input[] = "wordxn–word"; |
| | 650 | $output[] = "wordxn--word"; |
| | 651 | |
| | 652 | $input[] = "word ... word"; |
| | 653 | $output[] = "word … word"; |
| | 654 | |
| | 655 | $input[] = "word...word"; |
| | 656 | $output[] = "word…word"; |
| | 657 | |
| | 658 | $input[] = "word `` word"; |
| | 659 | $output[] = "word “ word"; |
| | 660 | |
| | 661 | $input[] = "word``word"; |
| | 662 | $output[] = "word“word"; |
| | 663 | |
| | 664 | $input[] = "word '' word"; |
| | 665 | $output[] = "word ” word"; |
| | 666 | |
| | 667 | $input[] = "word''word"; |
| | 668 | $output[] = "word”word"; |
| | 669 | |
| | 670 | $input[] = "word (tm) word"; |
| | 671 | $output[] = "word ™ word"; |
| | 672 | |
| | 673 | $input[] = "word (tm)word"; |
| | 674 | $output[] = "word ™word"; |
| | 675 | |
| | 676 | $input[] = "word(tm) word"; |
| | 677 | $output[] = "word(tm) word"; |
| | 678 | |
| | 679 | $input[] = "word(tm)word"; |
| | 680 | $output[] = "word(tm)word"; |
| | 681 | |
| | 682 | foreach($input as $key => $in) { |
| | 683 | $this->assertEquals( $output[$key], wptexturize( $in ) ); |
| | 684 | } |
| | 685 | } |
| | 686 | |
| | 687 | |
| | 688 | /** |
| | 689 | * All of these tests fail against 3.8 but were not yet listed above. |
| | 690 | * |
| | 691 | * @ticket 22692 |
| | 692 | */ |
| | 693 | function test_more_bugs() { |
| | 694 | $input = array(); |
| | 695 | $output = array(); |
| | 696 | |
| | 697 | // Tests derived from, and contrary to, the baseline patterns above, where output seemed unusual |
| | 698 | |
| | 699 | $input[] = "according to our source, '33% of all students scored less than 50' on the test."; |
| | 700 | $output[] = "according to our source, ‘33% of all students scored less than 50’ on the test."; |
| | 701 | |
| | 702 | $input[] = 'according to our source, "33% of all students scored less than 50" on the test.'; |
| | 703 | $output[] = 'according to our source, “33% of all students scored less than 50” on the test.'; |
| | 704 | |
| | 705 | $input[] = "word <'test quote'&rt; word"; |
| | 706 | $output[] = "word <‘test quote’&rt; word"; |
| | 707 | |
| | 708 | $input[] = 'word <"test quote"&rt; word'; |
| | 709 | $output[] = 'word <“test quote”&rt; word'; |
| | 710 | |
| | 711 | $input[] = "word 'em word"; |
| | 712 | $output[] = "word ’em word"; |
| | 713 | |
| | 714 | $input[] = "word xn– word"; |
| | 715 | $output[] = "word xn– word"; |
| | 716 | |
| | 717 | $input[] = "wordxn–word"; |
| | 718 | $output[] = "wordxn–word"; |
| | 719 | |
| | 720 | // ticket #4116 |
| | 721 | |
| | 722 | $input[] = "www.4x3.com"; |
| | 723 | $output[] = "www.4x3.com"; |
| | 724 | |
| | 725 | $input[] = "4x3.domain.com"; |
| | 726 | $output[] = "4x3.domain.com"; |
| | 727 | |
| | 728 | $input[] = "<a href='http://www.24x7.com/'>http://www.24x7.com/</a>"; |
| | 729 | $output[] = "<a href='http://www.24x7.com/'>http://www.24x7.com/</a>"; |
| | 730 | |
| | 731 | $input[] = "<a href='http://www.domain.com/24x7/'>http://www.domain.com/24x7/</a>"; |
| | 732 | $output[] = "<a href='http://www.domain.com/24x7/'>http://www.domain.com/24x7/</a>"; |
| | 733 | |
| | 734 | // ticket #6969 -- Some of these appear to be fixed already. |
| | 735 | |
| | 736 | $input[] = '[caption]<img src="http://localhost/Great_Wave.jpg" alt="Great Wave" title="Great Wave" width="300" height="205" /> The Great Wave[/caption]'; |
| | 737 | $output[] = '[caption]<img src="http://localhost/Great_Wave.jpg" alt="Great Wave" title="Great Wave" width="300" height="205" /> The Great Wave[/caption]'; |
| | 738 | |
| | 739 | $input[] = '[code lang="php"]$foo = \'bar\';[/code]'; |
| | 740 | $output[] = '[code lang="php"]$foo = \'bar\';[/code]'; |
| | 741 | |
| | 742 | $input[] = '[foobar]This is how you "quote" things.[/foobar]'; |
| | 743 | $output[] = '[foobar]This is how you "quote" things.[/foobar]'; |
| | 744 | |
| | 745 | $input[] = "<pre>\n[[php foo=\"bar\"]\necho \"foo\" . 'bar';\n[/php]]\n</pre>"; |
| | 746 | $output[] = "<pre>\n[[php foo=\"bar\"]\necho \"foo\" . 'bar';\n[/php]]\n</pre>"; |
| | 747 | |
| | 748 | $input[] = "foo[shortcode]\n\"bar\"\n[/shortcode]foo"; |
| | 749 | $output[] = "foo[shortcode]\n\"bar\"\n[/shortcode]foo"; |
| | 750 | |
| | 751 | // ticket #20342 |
| | 752 | |
| | 753 | $input[] = 'word---"quote"'; |
| | 754 | $output[] = 'word—“quote”'; |
| | 755 | |
| | 756 | $input[] = 'word--"quote"'; |
| | 757 | $output[] = 'word–“quote”'; |
| | 758 | |
| | 759 | $input[] = 'word-"quote"'; |
| | 760 | $output[] = 'word-“quote”'; |
| | 761 | |
| | 762 | // ticket #26850 |
| | 763 | |
| | 764 | $input[] = "in '4 years, 3 months,' Obama cut the deficit"; |
| | 765 | $output[] = "in ‘4 years, 3 months,’ Obama cut the deficit"; |
| | 766 | |
| | 767 | $input[] = "in '40 years, 3 months,' Obama cut the deficit"; |
| | 768 | $output[] = "in ‘40 years, 3 months,’ Obama cut the deficit"; |
| | 769 | |
| | 770 | $input[] = "in '400 years, 3 months,' Obama cut the deficit"; |
| | 771 | $output[] = "in ‘400 years, 3 months,’ Obama cut the deficit"; |
| | 772 | |
| | 773 | foreach($input as $key => $in) { |
| | 774 | $this->assertEquals( $output[$key], wptexturize( $in ) ); |
| | 775 | } |
| | 776 | } |