Fossil SCM
Add --slash option to test-canonical-name and test-relative-name
Commit
e6ced76797733d2c77116bf5012177929dc503a9
Parent
43c56304855aa89…
1 file changed
+4
-2
+4
-2
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -794,15 +794,16 @@ | ||
| 794 | 794 | ** Also test Fossil's ability to measure attributes of a file. |
| 795 | 795 | */ |
| 796 | 796 | void cmd_test_canonical_name(void){ |
| 797 | 797 | int i; |
| 798 | 798 | Blob x; |
| 799 | + int slashFlag = find_option("slash",0,0)!=0; | |
| 799 | 800 | blob_zero(&x); |
| 800 | 801 | for(i=2; i<g.argc; i++){ |
| 801 | 802 | char zBuf[100]; |
| 802 | 803 | const char *zName = g.argv[i]; |
| 803 | - file_canonical_name(zName, &x, 0); | |
| 804 | + file_canonical_name(zName, &x, slashFlag); | |
| 804 | 805 | fossil_print("[%s] -> [%s]\n", zName, blob_buffer(&x)); |
| 805 | 806 | blob_reset(&x); |
| 806 | 807 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_size(zName)); |
| 807 | 808 | fossil_print(" file_size = %s\n", zBuf); |
| 808 | 809 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_mtime(zName)); |
| @@ -916,14 +917,15 @@ | ||
| 916 | 917 | ** |
| 917 | 918 | ** Test the operation of the relative name generator. |
| 918 | 919 | */ |
| 919 | 920 | void cmd_test_relative_name(void){ |
| 920 | 921 | int i; |
| 922 | + int slashFlag = find_option("slash",0,0)!=0; | |
| 921 | 923 | Blob x; |
| 922 | 924 | blob_zero(&x); |
| 923 | 925 | for(i=2; i<g.argc; i++){ |
| 924 | - file_relative_name(g.argv[i], &x, 0); | |
| 926 | + file_relative_name(g.argv[i], &x, slashFlag); | |
| 925 | 927 | fossil_print("%s\n", blob_buffer(&x)); |
| 926 | 928 | blob_reset(&x); |
| 927 | 929 | } |
| 928 | 930 | } |
| 929 | 931 | |
| 930 | 932 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -794,15 +794,16 @@ | |
| 794 | ** Also test Fossil's ability to measure attributes of a file. |
| 795 | */ |
| 796 | void cmd_test_canonical_name(void){ |
| 797 | int i; |
| 798 | Blob x; |
| 799 | blob_zero(&x); |
| 800 | for(i=2; i<g.argc; i++){ |
| 801 | char zBuf[100]; |
| 802 | const char *zName = g.argv[i]; |
| 803 | file_canonical_name(zName, &x, 0); |
| 804 | fossil_print("[%s] -> [%s]\n", zName, blob_buffer(&x)); |
| 805 | blob_reset(&x); |
| 806 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_size(zName)); |
| 807 | fossil_print(" file_size = %s\n", zBuf); |
| 808 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_mtime(zName)); |
| @@ -916,14 +917,15 @@ | |
| 916 | ** |
| 917 | ** Test the operation of the relative name generator. |
| 918 | */ |
| 919 | void cmd_test_relative_name(void){ |
| 920 | int i; |
| 921 | Blob x; |
| 922 | blob_zero(&x); |
| 923 | for(i=2; i<g.argc; i++){ |
| 924 | file_relative_name(g.argv[i], &x, 0); |
| 925 | fossil_print("%s\n", blob_buffer(&x)); |
| 926 | blob_reset(&x); |
| 927 | } |
| 928 | } |
| 929 | |
| 930 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -794,15 +794,16 @@ | |
| 794 | ** Also test Fossil's ability to measure attributes of a file. |
| 795 | */ |
| 796 | void cmd_test_canonical_name(void){ |
| 797 | int i; |
| 798 | Blob x; |
| 799 | int slashFlag = find_option("slash",0,0)!=0; |
| 800 | blob_zero(&x); |
| 801 | for(i=2; i<g.argc; i++){ |
| 802 | char zBuf[100]; |
| 803 | const char *zName = g.argv[i]; |
| 804 | file_canonical_name(zName, &x, slashFlag); |
| 805 | fossil_print("[%s] -> [%s]\n", zName, blob_buffer(&x)); |
| 806 | blob_reset(&x); |
| 807 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_size(zName)); |
| 808 | fossil_print(" file_size = %s\n", zBuf); |
| 809 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_mtime(zName)); |
| @@ -916,14 +917,15 @@ | |
| 917 | ** |
| 918 | ** Test the operation of the relative name generator. |
| 919 | */ |
| 920 | void cmd_test_relative_name(void){ |
| 921 | int i; |
| 922 | int slashFlag = find_option("slash",0,0)!=0; |
| 923 | Blob x; |
| 924 | blob_zero(&x); |
| 925 | for(i=2; i<g.argc; i++){ |
| 926 | file_relative_name(g.argv[i], &x, slashFlag); |
| 927 | fossil_print("%s\n", blob_buffer(&x)); |
| 928 | blob_reset(&x); |
| 929 | } |
| 930 | } |
| 931 | |
| 932 |