Changeset 691 for trunk/ext
- Timestamp:
- 12/11/07 23:53:59 (1 year ago)
- Files:
-
- trunk/ext/jelix/jelix.c (modified) (3 diffs)
- trunk/ext/jelix/jelix.c (modified) (3 diffs)
- trunk/ext/jelix/php_jelix.h (modified) (1 diff)
- trunk/ext/jelix/php_jelix.h (modified) (1 diff)
- trunk/ext/jelix/tests/scan_action_sel_001.phpt (modified) (50 diffs)
- trunk/ext/jelix/tests/scan_action_sel_001.phpt (modified) (50 diffs)
- trunk/ext/jelix/tests/scan_action_sel_002.phpt (modified) (1 diff)
- trunk/ext/jelix/tests/scan_action_sel_002.phpt (modified) (1 diff)
- trunk/ext/jelix/tests/scan_old_action_sel_001.phpt (added)
- trunk/ext/jelix/tests/scan_old_action_sel_001.phpt (added)
- trunk/ext/jelix/tests/scan_old_action_sel_002.phpt (added)
- trunk/ext/jelix/tests/scan_old_action_sel_002.phpt (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ext/jelix/jelix.c
r669 r691 33 33 PHP_FE(jelix_scan_module_sel, NULL) 34 34 PHP_FE(jelix_scan_action_sel, NULL) 35 PHP_FE(jelix_scan_old_action_sel, NULL) 35 36 PHP_FE(jelix_scan_class_sel, NULL) 36 37 PHP_FE(jelix_scan_locale_sel, NULL) … … 412 413 /^(?:([a-zA-Z0-9_\.]+|\#)~)?([a-zA-Z0-9_]+|\#)?(?:@([a-zA-Z0-9_]+))?$/ 413 414 */ 414 PHP_FUNCTION(jelix_scan_ action_sel)415 PHP_FUNCTION(jelix_scan_old_action_sel) 415 416 { 416 417 zval **selectorStr, **objectArg, **defaultActionArg; … … 651 652 /* }}} */ 652 653 654 655 /* {{{ proto boolean jelix_scan_action_sel(string arg, object tofill *) 656 scan a string as a jelix selector, and fill object properties with founded values 657 /^(?:([a-zA-Z0-9_\.]+|\#)~)?([a-zA-Z0-9_:]+|\#)?(?:@([a-zA-Z0-9_]+))?$/ 658 */ 659 PHP_FUNCTION(jelix_scan_action_sel) 660 { 661 zval **selectorStr, **objectArg, **defaultActionArg; 662 int length; 663 char * sel, *cursor, *module, *resource, *request; 664 665 666 if(ZEND_NUM_ARGS() != 3) { 667 ZEND_WRONG_PARAM_COUNT(); 668 } 669 if (zend_get_parameters_ex(3, &selectorStr, &objectArg, &defaultActionArg) == FAILURE) { 670 php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot read arguments"); 671 RETURN_FALSE; 672 } 673 674 if(Z_TYPE_P(*objectArg) != IS_OBJECT){ 675 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid second argument, not an object"); 676 RETURN_FALSE 677 } 678 if(Z_TYPE_P(*defaultActionArg) != IS_STRING){ 679 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid third argument, not a string"); 680 RETURN_FALSE 681 } 682 683 int module_length=0; 684 int resource_length=0; 685 int request_length=0; 686 int cursor_count=0; 687 688 convert_to_string_ex(selectorStr); 689 length = Z_STRLEN_PP(selectorStr); 690 sel = Z_STRVAL_PP(selectorStr); 691 692 cursor_count=0; 693 cursor = module = resource = sel; 694 695 int error = 0; 696 int sharpOk = 0; 697 int hasRequest=0; 698 int firstDashPos = -1; 699 int hasDot = 0; 700 701 // parse the module part 702 while(cursor_count < length){ 703 if(*cursor == '~' || *cursor == '@'){ 704 break; 705 } 706 if(*cursor == '#'){ 707 if(sharpOk || module_length > 1){ 708 RETURN_FALSE 709 } 710 sharpOk=1; 711 }else if(*cursor == '.'){ 712 hasDot = 1; 713 }else if(!( ( *cursor >= 'a' && *cursor <= 'z') 714 || ( *cursor >= 'A' && *cursor <= 'Z') 715 || ( *cursor >= '0' && *cursor <= '9') 716 || *cursor == '_' || *cursor == ':' ) || sharpOk){ 717 RETURN_FALSE 718 } 719 if(*cursor == ':' && firstDashPos == -1){ 720 firstDashPos = module_length; 721 } 722 723 module_length ++; 724 cursor_count ++; 725 cursor++; 726 } 727 728 if(cursor_count >= length){ 729 // we don't find any '~' characters, so we have parsed the resource 730 if(hasDot) RETURN_FALSE 731 732 resource_length = module_length; 733 module_length = 0; 734 }else if( *cursor == '@'){ 735 // we don't find any '~' characters, so we have parsed the resource 736 if(hasDot) RETURN_FALSE 737 738 resource_length = module_length; 739 module_length = 0; 740 hasRequest = 1; 741 // now we parse the @ section 742 cursor_count ++; 743 cursor++; 744 745 request = cursor; 746 request_length = 0; 747 while(cursor_count < length){ 748 if(!( ( *cursor >= 'a' && *cursor <= 'z') 749 || ( *cursor >= 'A' && *cursor <= 'Z') 750 || ( *cursor >= '0' && *cursor <= '9') 751 || *cursor == '_' || *cursor == ':' || *cursor == '.')){ 752 RETURN_FALSE 753 } 754 request_length ++; 755 cursor_count ++; 756 cursor++; 757 } 758 }else{ 759 // the string starts by a ~ : it's not really a problem, but we generate an error 760 // to keep compatibily with php version of selectors. 761 if(module_length == 0){ 762 RETURN_FALSE 763 } 764 firstDashPos=-1; 765 cursor_count++; 766 cursor++; 767 resource = cursor; 768 resource_length = 0; 769 sharpOk = 0; 770 while(cursor_count < length){ 771 if(*cursor == '@'){ 772 break; 773 } 774 775 if(*cursor == '#'){ 776 if(sharpOk || resource_length > 1){ 777 RETURN_FALSE 778 } 779 sharpOk=1; 780 }else if(!( ( *cursor >= 'a' && *cursor <= 'z') 781 || ( *cursor >= 'A' && *cursor <= 'Z') 782 || ( *cursor >= '0' && *cursor <= '9') 783 || *cursor == '_' || *cursor == ':') || sharpOk){ 784 RETURN_FALSE 785 } 786 if(*cursor == ':' && firstDashPos == -1){ 787 firstDashPos = resource_length; 788 } 789 790 resource_length ++; 791 cursor_count ++; 792 cursor++; 793 } 794 795 if(*cursor == '@'){ 796 hasRequest = 1; 797 cursor_count++; 798 cursor++; 799 request = cursor; 800 request_length = 0; 801 while(cursor_count < length){ 802 if(!( ( *cursor >= 'a' && *cursor <= 'z') 803 || ( *cursor >= 'A' && *cursor <= 'Z') 804 || ( *cursor >= '0' && *cursor <= '9') 805 || *cursor == '_' || *cursor == '.')){ 806 RETURN_FALSE 807 } 808 request_length ++; 809 cursor_count ++; 810 cursor++; 811 } 812 } 813 } 814 815 // request shouldn't empty if there is a @ 816 if(hasRequest && request_length == 0){ 817 RETURN_FALSE 818 } 819 820 if(resource_length == 0){ 821 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "resource", sizeof("resource") - 1, "default_index", sizeof("default_index")-1 TSRMLS_CC); 822 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "controller", sizeof("controller") - 1, "default", sizeof("default")-1 TSRMLS_CC); 823 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "method", sizeof("method") - 1, "index", sizeof("index")-1 TSRMLS_CC); 824 }else{ 825 if(resource_length == 1 && *resource == '#'){ 826 resource_length = Z_STRLEN_PP(defaultActionArg); 827 resource = Z_STRVAL_PP(defaultActionArg); 828 firstDashPos=-1; 829 int i; 830 for(i=0; i < resource_length;i++){ 831 if(resource[i] == '_'){ 832 firstDashPos=i; 833 break; 834 } 835 } 836 } 837 838 if(firstDashPos == -1){ 839 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "controller", sizeof("controller") - 1, "default", sizeof("default")-1 TSRMLS_CC); 840 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "method", sizeof("method") - 1, resource, resource_length TSRMLS_CC); 841 842 char *r; 843 int ld = sizeof("default:") -1; 844 int lr = ld + resource_length; 845 r= emalloc(lr+1); 846 if (r) { 847 memcpy(r, "default:", ld); 848 memcpy(r+ld, resource, resource_length); 849 r[lr] = 0; 850 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "resource", sizeof("resource") - 1, r, lr TSRMLS_CC); 851 efree(r); 852 } 853 854 }else if(firstDashPos == 0){ 855 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "controller", sizeof("controller") - 1, "default", sizeof("default")-1 TSRMLS_CC); 856 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "method", sizeof("method") - 1, resource+1, resource_length-1 TSRMLS_CC); 857 858 char *r; 859 int ld = sizeof("default") -1; 860 int lr = ld + resource_length; 861 r= emalloc(lr+1); 862 if (r) { 863 memcpy(r, "default", ld); 864 memcpy(r+ld, resource, resource_length); 865 r[lr] = 0; 866 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "resource", sizeof("resource") - 1, r, lr TSRMLS_CC); 867 efree(r); 868 } 869 870 }else if(firstDashPos == resource_length-1){ 871 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "controller", sizeof("controller") - 1, resource, resource_length-1 TSRMLS_CC); 872 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "method", sizeof("method") - 1, "index", sizeof("index")-1 TSRMLS_CC); 873 char *r; 874 int ld = sizeof("index") -1; 875 int lr = resource_length + ld; 876 r= emalloc(lr+1); 877 if (r) { 878 memcpy(r, resource, resource_length); 879 memcpy(r+resource_length, "index", ld); 880 r[lr] = 0; 881 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "resource", sizeof("resource") - 1, r, lr TSRMLS_CC); 882 efree(r); 883 } 884 885 }else{ 886 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "controller", sizeof("controller") - 1, resource, firstDashPos TSRMLS_CC); 887 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "method", sizeof("method") - 1, resource+firstDashPos+1, resource_length-firstDashPos-1 TSRMLS_CC); 888 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "resource", sizeof("resource") - 1, resource, resource_length TSRMLS_CC); 889 } 890 } 891 892 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "module", sizeof("module") - 1, module, module_length TSRMLS_CC); 893 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "request", sizeof("request") - 1, request, request_length TSRMLS_CC); 894 RETURN_TRUE 895 } 896 /* }}} */ 897 898 653 899 /* {{{ proto boolean jelix_scan_class_sel(string arg, object tofill *) 654 900 scan a string as a jelix selector, and fill object properties with founded values trunk/ext/jelix/jelix.c
r669 r691 33 33 PHP_FE(jelix_scan_module_sel, NULL) 34 34 PHP_FE(jelix_scan_action_sel, NULL) 35 PHP_FE(jelix_scan_old_action_sel, NULL) 35 36 PHP_FE(jelix_scan_class_sel, NULL) 36 37 PHP_FE(jelix_scan_locale_sel, NULL) … … 412 413 /^(?:([a-zA-Z0-9_\.]+|\#)~)?([a-zA-Z0-9_]+|\#)?(?:@([a-zA-Z0-9_]+))?$/ 413 414 */ 414 PHP_FUNCTION(jelix_scan_ action_sel)415 PHP_FUNCTION(jelix_scan_old_action_sel) 415 416 { 416 417 zval **selectorStr, **objectArg, **defaultActionArg; … … 651 652 /* }}} */ 652 653 654 655 /* {{{ proto boolean jelix_scan_action_sel(string arg, object tofill *) 656 scan a string as a jelix selector, and fill object properties with founded values 657 /^(?:([a-zA-Z0-9_\.]+|\#)~)?([a-zA-Z0-9_:]+|\#)?(?:@([a-zA-Z0-9_]+))?$/ 658 */ 659 PHP_FUNCTION(jelix_scan_action_sel) 660 { 661 zval **selectorStr, **objectArg, **defaultActionArg; 662 int length; 663 char * sel, *cursor, *module, *resource, *request; 664 665 666 if(ZEND_NUM_ARGS() != 3) { 667 ZEND_WRONG_PARAM_COUNT(); 668 } 669 if (zend_get_parameters_ex(3, &selectorStr, &objectArg, &defaultActionArg) == FAILURE) { 670 php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot read arguments"); 671 RETURN_FALSE; 672 } 673 674 if(Z_TYPE_P(*objectArg) != IS_OBJECT){ 675 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid second argument, not an object"); 676 RETURN_FALSE 677 } 678 if(Z_TYPE_P(*defaultActionArg) != IS_STRING){ 679 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid third argument, not a string"); 680 RETURN_FALSE 681 } 682 683 int module_length=0; 684 int resource_length=0; 685 int request_length=0; 686 int cursor_count=0; 687 688 convert_to_string_ex(selectorStr); 689 length = Z_STRLEN_PP(selectorStr); 690 sel = Z_STRVAL_PP(selectorStr); 691 692 cursor_count=0; 693 cursor = module = resource = sel; 694 695 int error = 0; 696 int sharpOk = 0; 697 int hasRequest=0; 698 int firstDashPos = -1; 699 int hasDot = 0; 700 701 // parse the module part 702 while(cursor_count < length){ 703 if(*cursor == '~' || *cursor == '@'){ 704 break; 705 } 706 if(*cursor == '#'){ 707 if(sharpOk || module_length > 1){ 708 RETURN_FALSE 709 } 710 sharpOk=1; 711 }else if(*cursor == '.'){ 712 hasDot = 1; 713 }else if(!( ( *cursor >= 'a' && *cursor <= 'z') 714 || ( *cursor >= 'A' && *cursor <= 'Z') 715 || ( *cursor >= '0' && *cursor <= '9') 716 || *cursor == '_' || *cursor == ':' ) || sharpOk){ 717 RETURN_FALSE 718 } 719 if(*cursor == ':' && firstDashPos == -1){ 720 firstDashPos = module_length; 721 } 722 723 module_length ++; 724 cursor_count ++; 725 cursor++; 726 } 727 728 if(cursor_count >= length){ 729 // we don't find any '~' characters, so we have parsed the resource 730 if(hasDot) RETURN_FALSE 731 732 resource_length = module_length; 733 module_length = 0; 734 }else if( *cursor == '@'){ 735 // we don't find any '~' characters, so we have parsed the resource 736 if(hasDot) RETURN_FALSE 737 738 resource_length = module_length; 739 module_length = 0; 740 hasRequest = 1; 741 // now we parse the @ section 742 cursor_count ++; 743 cursor++; 744 745 request = cursor; 746 request_length = 0; 747 while(cursor_count < length){ 748 if(!( ( *cursor >= 'a' && *cursor <= 'z') 749 || ( *cursor >= 'A' && *cursor <= 'Z') 750 || ( *cursor >= '0' && *cursor <= '9') 751 || *cursor == '_' || *cursor == ':' || *cursor == '.')){ 752 RETURN_FALSE 753 } 754 request_length ++; 755 cursor_count ++; 756 cursor++; 757 } 758 }else{ 759 // the string starts by a ~ : it's not really a problem, but we generate an error 760 // to keep compatibily with php version of selectors. 761 if(module_length == 0){ 762 RETURN_FALSE 763 } 764 firstDashPos=-1; 765 cursor_count++; 766 cursor++; 767 resource = cursor; 768 resource_length = 0; 769 sharpOk = 0; 770 while(cursor_count < length){ 771 if(*cursor == '@'){ 772 break; 773 } 774 775 if(*cursor == '#'){ 776 if(sharpOk || resource_length > 1){ 777 RETURN_FALSE 778 } 779 sharpOk=1; 780 }else if(!( ( *cursor >= 'a' && *cursor <= 'z') 781 || ( *cursor >= 'A' && *cursor <= 'Z') 782 || ( *cursor >= '0' && *cursor <= '9') 783 || *cursor == '_' || *cursor == ':') || sharpOk){ 784 RETURN_FALSE 785 } 786 if(*cursor == ':' && firstDashPos == -1){ 787 firstDashPos = resource_length; 788 } 789 790 resource_length ++; 791 cursor_count ++; 792 cursor++; 793 } 794 795 if(*cursor == '@'){ 796 hasRequest = 1; 797 cursor_count++; 798 cursor++; 799 request = cursor; 800 request_length = 0; 801 while(cursor_count < length){ 802 if(!( ( *cursor >= 'a' && *cursor <= 'z') 803 || ( *cursor >= 'A' && *cursor <= 'Z') 804 || ( *cursor >= '0' && *cursor <= '9') 805 || *cursor == '_' || *cursor == '.')){ 806 RETURN_FALSE 807 } 808 request_length ++; 809 cursor_count ++; 810 cursor++; 811 } 812 } 813 } 814 815 // request shouldn't empty if there is a @ 816 if(hasRequest && request_length == 0){ 817 RETURN_FALSE 818 } 819 820 if(resource_length == 0){ 821 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "resource", sizeof("resource") - 1, "default_index", sizeof("default_index")-1 TSRMLS_CC); 822 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "controller", sizeof("controller") - 1, "default", sizeof("default")-1 TSRMLS_CC); 823 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "method", sizeof("method") - 1, "index", sizeof("index")-1 TSRMLS_CC); 824 }else{ 825 if(resource_length == 1 && *resource == '#'){ 826 resource_length = Z_STRLEN_PP(defaultActionArg); 827 resource = Z_STRVAL_PP(defaultActionArg); 828 firstDashPos=-1; 829 int i; 830 for(i=0; i < resource_length;i++){ 831 if(resource[i] == '_'){ 832 firstDashPos=i; 833 break; 834 } 835 } 836 } 837 838 if(firstDashPos == -1){ 839 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "controller", sizeof("controller") - 1, "default", sizeof("default")-1 TSRMLS_CC); 840 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "method", sizeof("method") - 1, resource, resource_length TSRMLS_CC); 841 842 char *r; 843 int ld = sizeof("default:") -1; 844 int lr = ld + resource_length; 845 r= emalloc(lr+1); 846 if (r) { 847 memcpy(r, "default:", ld); 848 memcpy(r+ld, resource, resource_length); 849 r[lr] = 0; 850 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "resource", sizeof("resource") - 1, r, lr TSRMLS_CC); 851 efree(r); 852 } 853 854 }else if(firstDashPos == 0){ 855 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "controller", sizeof("controller") - 1, "default", sizeof("default")-1 TSRMLS_CC); 856 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "method", sizeof("method") - 1, resource+1, resource_length-1 TSRMLS_CC); 857 858 char *r; 859 int ld = sizeof("default") -1; 860 int lr = ld + resource_length; 861 r= emalloc(lr+1); 862 if (r) { 863 memcpy(r, "default", ld); 864 memcpy(r+ld, resource, resource_length); 865 r[lr] = 0; 866 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "resource", sizeof("resource") - 1, r, lr TSRMLS_CC); 867 efree(r); 868 } 869 870 }else if(firstDashPos == resource_length-1){ 871 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "controller", sizeof("controller") - 1, resource, resource_length-1 TSRMLS_CC); 872 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "method", sizeof("method") - 1, "index", sizeof("index")-1 TSRMLS_CC); 873 char *r; 874 int ld = sizeof("index") -1; 875 int lr = resource_length + ld; 876 r= emalloc(lr+1); 877 if (r) { 878 memcpy(r, resource, resource_length); 879 memcpy(r+resource_length, "index", ld); 880 r[lr] = 0; 881 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "resource", sizeof("resource") - 1, r, lr TSRMLS_CC); 882 efree(r); 883 } 884 885 }else{ 886 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "controller", sizeof("controller") - 1, resource, firstDashPos TSRMLS_CC); 887 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "method", sizeof("method") - 1, resource+firstDashPos+1, resource_length-firstDashPos-1 TSRMLS_CC); 888 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "resource", sizeof("resource") - 1, resource, resource_length TSRMLS_CC); 889 } 890 } 891 892 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "module", sizeof("module") - 1, module, module_length TSRMLS_CC); 893 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "request", sizeof("request") - 1, request, request_length TSRMLS_CC); 894 RETURN_TRUE 895 } 896 /* }}} */ 897 898 653 899 /* {{{ proto boolean jelix_scan_class_sel(string arg, object tofill *) 654 900 scan a string as a jelix selector, and fill object properties with founded values trunk/ext/jelix/php_jelix.h
r649 r691 36 36 PHP_FUNCTION(jelix_scan_module_sel); 37 37 PHP_FUNCTION(jelix_scan_action_sel); 38 PHP_FUNCTION(jelix_scan_old_action_sel); 38 39 PHP_FUNCTION(jelix_scan_class_sel); 39 40 PHP_FUNCTION(jelix_scan_locale_sel); trunk/ext/jelix/php_jelix.h
r649 r691 36 36 PHP_FUNCTION(jelix_scan_module_sel); 37 37 PHP_FUNCTION(jelix_scan_action_sel); 38 PHP_FUNCTION(jelix_scan_old_action_sel); 38 39 PHP_FUNCTION(jelix_scan_class_sel); 39 40 PHP_FUNCTION(jelix_scan_locale_sel); trunk/ext/jelix/tests/scan_action_sel_001.phpt
r389 r691 13 13 } 14 14 15 $tests = array( 0=>"toto", 1=>"aaa~toto", 2=>"aa_AZ123aR~toPO _etto", 3=>"foo.bar~trucmuche", 4=>"#",15 $tests = array( 0=>"toto", 1=>"aaa~toto", 2=>"aa_AZ123aR~toPO:etto", 3=>"foo.bar~trucmuche", 4=>"#", 16 16 5=>"#~foo", 6=>"foo~#", 7=>"#~#", 8=>"@classic", 9=>"foo.bar~trucmuche@classic", 17 10=>"foo.bar~truc _muche@classic", 11=>"#@classic", 12=>"#~foo@classic",17 10=>"foo.bar~truc:muche@classic", 11=>"#@classic", 12=>"#~foo@classic", 18 18 13=>"foo~#@classic", 14=>"#~#@classic", 19 15=>"testapp~ctrl_meth@truc", 16=>"testapp~_meth@truc", 17=>"testapp~meth@truc", 20 18=>"testapp~ctrl_@truc", 19=>"testapp~@truc", 20=>"testapp~#@truc", 21 21=>"testapp~ctrl_meth", 22=>"testapp~_meth", 23=>"testapp~meth", 22 24=>"testapp~ctrl_", 25=>"testapp~", 26=>"testapp~#", 23 27=>"#~ctrl_meth@truc", 28=>"#~_meth@truc", 29=>"#~meth@truc", 24 30=>"#~ctrl_@truc", 31=>"#~@truc", 32=>"#~#@truc", 25 33=>"#~ctrl_meth", 34=>"#~_meth", 35=>"#~meth", 26 36=>"#~ctrl_", 37=>"#~", 38=>"#~#", 39=>"ctrl_meth@truc", 27 40=>"_meth@truc", 41=>"ctrl_@truc", 42=>"@truc", 28 43=>"#@truc", 44=>"ctrl_meth", 45=>"_meth", 29 46=>"meth", 47=>"ctrl_", 48=>"", 19 15=>"testapp~ctrl:meth@truc", 16=>"testapp~:meth@truc", 17=>"testapp~meth@truc", 20 18=>"testapp~ctrl:@truc", 19=>"testapp~@truc", 20=>"testapp~#@truc", 21 21=>"testapp~ctrl:meth", 22=>"testapp~:meth", 23=>"testapp~meth", 22 24=>"testapp~ctrl:", 25=>"testapp~", 26=>"testapp~#", 23 27=>"#~ctrl:meth@truc", 28=>"#~:meth@truc", 29=>"#~meth@truc", 24 30=>"#~ctrl:@truc", 31=>"#~@truc", 32=>"#~#@truc", 25 33=>"#~ctrl:meth", 34=>"#~:meth", 35=>"#~meth", 26 36=>"#~ctrl:", 37=>"#~", 38=>"#~#", 39=>"ctrl:meth@truc", 27 40=>":meth@truc", 41=>"ctrl:@truc", 42=>"@truc", 28 43=>"#@truc", 44=>"ctrl:meth", 45=>":meth", 29 46=>"meth", 47=>"ctrl:", 48=>"", 30 49=>"aa_AZ123aR~to_PO:etto", 31 50=>"aa_AZ123aR~toPO:et_to", 32 51=>"aa_AZ123aR~t_oPO:et_t_o", 30 33 ); 31 34 … … 52 55 0:ok 53 56 m= 54 r=default _toto57 r=default:toto 55 58 q= 56 59 c=default … … 58 61 1:ok 59 62 m=aaa 60 r=default _toto63 r=default:toto 61 64 q= 62 65 c=default … … 64 67 2:ok 65 68 m=aa_AZ123aR 66 r=toPO _etto69 r=toPO:etto 67 70 q= 68 71 c=toPO … … 70 73 3:ok 71 74 m=foo.bar 72 r=default _trucmuche75 r=default:trucmuche 73 76 q= 74 77 c=default … … 76 79 4:ok 77 80 m= 78 r=machin _bidule81 r=machin:bidule 79 82 q= 80 83 c=machin … … 82 85 5:ok 83 86 m=# 84 r=default _foo87 r=default:foo 85 88 q= 86 89 c=default … … 88 91 6:ok 89 92 m=foo 90 r=machin _bidule93 r=machin:bidule 91 94 q= 92 95 c=machin … … 94 97 7:ok 95 98 m=# 96 r=machin _bidule99 r=machin:bidule 97 100 q= 98 101 c=machin … … 100 103 8:ok 101 104 m= 102 r=default _index105 r=default:index 103 106 q=classic 104 107 c=default … … 106 109 9:ok 107 110 m=foo.bar 108 r=default _trucmuche111 r=default:trucmuche 109 112 q=classic 110 113 c=default … … 112 115 10:ok 113 116 m=foo.bar 114 r=truc _muche117 r=truc:muche 115 118 q=classic 116 119 c=truc … … 118 121 11:ok 119 122 m= 120 r=machin _bidule123 r=machin:bidule 121 124 q=classic 122 125 c=machin … … 124 127 12:ok 125 128 m=# 126 r=default _foo129 r=default:foo 127 130 q=classic 128 131 c=default … … 130 133 13:ok 131 134 m=foo 132 r=machin _bidule135 r=machin:bidule 133 136 q=classic 134 137 c=machin … … 136 139 14:ok 137 140 m=# 138 r=machin _bidule141 r=machin:bidule 139 142 q=classic 140 143 c=machin … … 142 145 15:ok 143 146 m=testapp 144 r=ctrl _meth147 r=ctrl:meth 145 148 q=truc 146 149 c=ctrl … … 148 151 16:ok 149 152 m=testapp 150 r=default _meth153 r=default:meth 151 154 q=truc 152 155 c=default … … 154 157 17:ok 155 158 m=testapp 156 r=default _meth159 r=default:meth 157 160 q=truc 158 161 c=default … … 160 163 18:ok 161 164 m=testapp 162 r=ctrl _index165 r=ctrl:index 163 166 q=truc 164 167 c=ctrl … … 166 169 19:ok 167 170 m=testapp 168 r=default _index171 r=default:index 169 172 q=truc 170 173 c=default … … 172 175 20:ok 173 176 m=testapp 174 r=machin _bidule177 r=machin:bidule 175 178 q=truc 176 179 c=machin … … 178 181 21:ok 179 182 m=testapp 180 r=ctrl _meth183 r=ctrl:meth 181 184 q= 182 185 c=ctrl … … 184 187 22:ok 185 188 m=testapp 186 r=default _meth189 r=default:meth 187 190 q= 188 191 c=default … … 190 193 23:ok 191 194 m=testapp 192 r=default _meth195 r=default:meth 193 196 q= 194 197 c=default … … 196 199 24:ok 197 200 m=testapp 198 r=ctrl _index201 r=ctrl:index 199 202 q= 200 203 c=ctrl … … 202 205 25:ok 203 206 m=testapp 204 r=default _index207 r=default:index 205 208 q= 206 209 c=default … … 208 211 26:ok 209 212 m=testapp 210 r=machin _bidule213 r=machin:bidule 211 214 q= 212 215 c=machin … … 214 217 27:ok 215 218 m=# 216 r=ctrl _meth219 r=ctrl:meth 217 220 q=truc 218 221 c=ctrl … … 220 223 28:ok 221 224 m=# 222 r=default _meth225 r=default:meth 223 226 q=truc 224 227 c=default … … 226 229 29:ok 227 230 m=# 228 r=default _meth231 r=default:meth 229 232 q=truc 230 233 c=default … … 232 235 30:ok 233 236 m=# 234 r=ctrl _index237 r=ctrl:index 235 238 q=truc 236 239 c=ctrl … … 238 241 31:ok 239 242 m=# 240 r=default _index243 r=default:index 241 244 q=truc 242 245 c=default … … 244 247 32:ok 245 248 m=# 246 r=machin _bidule249 r=machin:bidule 247 250 q=truc 248 251 c=machin … … 250 253 33:ok 251 254 m=# 252 r=ctrl _meth255 r=ctrl:meth 253 256 q= 254 257 c=ctrl … … 256 259 34:ok 257 260 m=# 258 r=default _meth261 r=default:meth 259 262 q= 260 263 c=default … … 262 265 35:ok 263 266 m=# 264 r=default _meth267 r=default:meth 265 268 q= 266 269 c=default … … 268 271 36:ok 269 272 m=# 270 r=ctrl _index273 r=ctrl:index 271 274 q= 272 275 c=ctrl … … 274 277 37:ok 275 278 m=# 276 r=default _index279 r=default:index 277 280 q= 278 281 c=default … … 280 283 38:ok 281 284 m=# 282 r=machin _bidule285 r=machin:bidule 283 286 q= 284 287 c=machin … … 286 289 39:ok 287 290 m= 288 r=ctrl _meth291 r=ctrl:meth 289 292 q=truc 290 293 c=ctrl … … 292 295 40:ok 293 296 m= 294 r=default _meth297 r=default:meth 295 298 q=truc 296 299 c=default … … 298 301 41:ok 299 302 m= 300 r=ctrl _index303 r=ctrl:index 301 304 q=truc 302 305 c=ctrl … … 304 307 42:ok 305 308 m= 306 r=default _index309 r=default:index 307 310 q=truc 308 311 c=default … … 310 313 43:ok 311 314 m= 312 r=machin _bidule315 r=machin:bidule 313 316 q=truc 314 317 c=machin … … 316 319 44:ok 317 320 m= 318 r=ctrl _meth321 r=ctrl:meth 319 322 q= 320 323 c=ctrl … … 322 325 45:ok 323 326 m= 324 r=default _meth327 r=default:meth 325 328 q= 326 329 c=default … … 328 331 46:ok 329 332 m= 330 r=default _meth333 r=default:meth 331 334 q= 332 335 c=default … … 334 337 47:ok 335 338 m= 336 r=ctrl _index339 r=ctrl:index 337 340 q= 338 341 c=ctrl … … 340 343 48:ok 341 344 m= 342 r=default_index 343 q= 344 c=default 345 m=index 345 r=default:index 346 q= 347 c=default 348 m=index 349 49:ok 350 m=aa_AZ123aR 351 r=to_PO:etto 352 q= 353 c=to_PO 354 m=etto 355 50:ok 356 m=aa_AZ123aR 357 r=toPO:et_to 358 q= 359 c=toPO 360 m=et_to 361 51:ok 362 m=aa_AZ123aR 363 r=t_oPO:et_t_o 364 q= 365 c=t_oPO 366 m=et_t_o trunk/ext/jelix/tests/scan_action_sel_001.phpt
r389 r691 13 13 } 14 14 15 $tests = array( 0=>"toto", 1=>"aaa~toto", 2=>"aa_AZ123aR~toPO _etto", 3=>"foo.bar~trucmuche", 4=>"#",15 $tests = array( 0=>"toto", 1=>"aaa~toto", 2=>"aa_AZ123aR~toPO:etto", 3=>"foo.bar~trucmuche", 4=>"#", 16 16 5=>"#~foo", 6=>"foo~#", 7=>"#~#", 8=>"@classic", 9=>"foo.bar~trucmuche@classic", 17 10=>"foo.bar~truc _muche@classic", 11=>"#@classic", 12=>"#~foo@classic",17 10=>"foo.bar~truc:muche@classic", 11=>"#@classic", 12=>"#~foo@classic", 18 18 13=>"foo~#@classic", 14=>"#~#@classic", 19 15=>"testapp~ctrl_meth@truc", 16=>"testapp~_meth@truc", 17=>"testapp~meth@truc", 20 18=>"testapp~ctrl_@truc", 19=>"testapp~@truc", 20=>"testapp~#@truc", 21 21=>"testapp~ctrl_meth", 22=>"testapp~_meth", 23=>"testapp~meth", 22 24=>"testapp~ctrl_", 25=>"testapp~", 26=>"testapp~#", 23 27=>"#~ctrl_meth@truc", 28=>"#~_meth@truc", 29=>"#~meth@truc", 24 30=>"#~ctrl_@truc", 31=>"#~@truc", 32=>"#~#@truc", 25 33=>"#~ctrl_meth", 34=>"#~_meth", 35=>"#~meth", 26 36=>"#~ctrl_", 37=>"#~", 38=>"#~#", 39=>"ctrl_meth@truc", 27 40=>"_meth@truc", 41=>"ctrl_@truc", 42=>"@truc", 28 43=>"#@truc", 44=>"ctrl_meth", 45=>"_meth", 29 46=>"meth", 47=>"ctrl_", 48=>"", 19 15=>"testapp~ctrl:meth@truc", 16=>"testapp~:meth@truc", 17=>"testapp~meth@truc", 20 18=>"testapp~ctrl:@truc", 19=>"testapp~@truc", 20=>"testapp~#@truc", 21 21=>"testapp~ctrl:meth", 22=>"testapp~:meth", 23=>"testapp~meth", 22 24=>"testapp~ctrl:", 25=>"testapp~", 26=>"testapp~#", 23 &
