0030692: Data Exchange - introduce base framework RWMesh for importing mesh data...
[occt.git] / tests / collections / n / osdpath
1 puts "============="
2 puts "OSD_Path - test file path parsing tools"
3 puts "============="
4
5 pload QAcommands
6
7 if { [QAOsdPathType {c:\folder\file.png}]              != "absolute dos " }              { puts "Error: DOS path misdetection" }
8 if { [QAOsdPathType {c:\file.png}]                     != "absolute dos " }              { puts "Error: DOS path misdetection" }
9 if { [QAOsdPathType "D:\\"]                            != "absolute dos " }              { puts "Error: DOS root misdetection" }
10 if { [QAOsdPathType {\\share\file.pdf}]                != "absolute unc " }              { puts "Error: UNC path misdetection" }
11 if { [QAOsdPathType {\\?\C:\documents\file.docx}]      != "absolute ntextended " }       { puts "Error: NT Extended path misdetection" }
12 if { [QAOsdPathType {\\?\UNC\server\share\file.zip}]   != "absolute unc ntextended uncextended " } { puts "Error: UNC extended path misdetection" }
13 if { [QAOsdPathType {https://www.server.org/file.gif}] != "absolute protocol " }         { puts "Error: remote protocal path misdetection" }
14 if { [QAOsdPathType {content://file.jpg}]              != "absolute protocol content " } { puts "Error: content protocal path misdetection" }
15 if { [QAOsdPathType {/home/username/file.txt}]         != "absolute unix " }             { puts "Error: Unix path misdetection" }
16 if { [QAOsdPathType {/boot.bin}]                       != "absolute unix " }             { puts "Error: Unix path misdetection" }
17 if { [QAOsdPathType {/}]                               != "absolute unix " }             { puts "Error: Unix root misdetection" }
18 if { [QAOsdPathType {./subfolder/../file.txt}]         != "relative " }                  { puts "Error: Realtive path misdetection" }
19 if { [QAOsdPathType {../file.txt}]                     != "relative " }                  { puts "Error: Realtive path misdetection" }
20 if { [QAOsdPathType {.}]                               != "relative " }                  { puts "Error: Realtive path misdetection" }
21 if { [QAOsdPathType {..}]                              != "relative " }                  { puts "Error: Realtive path misdetection" }
22 if { [QAOsdPathType {image.png}]                       != "relative " }                  { puts "Error: Realtive path misdetection" }
23
24 if { [QAOsdPathPart {image.png} -folder]                   != "" }                  { puts "Error: Empty folder misdetected" }
25 if { [QAOsdPathPart {image.png} -fileName]                 != "image.png" }         { puts "Error: File name misdetected" }
26 if { [QAOsdPathPart {c:\folder\file.png} -folder]          != "c:\\folder\\" }      { puts "Error: DOS folder misdetected" }
27 if { [QAOsdPathPart {c:\folder\file.png} -fileName]        != "file.png" }          { puts "Error: DOS file name misdetected" }
28 if { [QAOsdPathPart {c:\file.png} -folder]                 != "c:\\" }              { puts "Error: DOS folder misdetected" }
29 if { [QAOsdPathPart {c:\file.png} -fileName]               != "file.png" }          { puts "Error: DOS file name misdetected" }
30 if { [QAOsdPathPart "D:\\" -folder]                        != "D:\\" }              { puts "Error: DOS root misdetected" }
31 if { [QAOsdPathPart "D:\\" -fileName]                      != "" }                  { puts "Error: DOS root misdetected" }
32 if { [QAOsdPathPart "/" -folder]                           != "/" }                 { puts "Error: Unit root misdetected" }
33 if { [QAOsdPathPart "/" -fileName]                         != "" }                  { puts "Error: Unit root misdetected" }
34 if { [QAOsdPathPart {subfolder/file.txt} -folder]          != "subfolder/" }        { puts "Error: Relative folder misdetected" }
35 if { [QAOsdPathPart {subfolder/file.txt} -fileName]        != "file.txt" }          { puts "Error: Relative file name misdetected" }
36 if { [QAOsdPathPart {./subfolder/../file.txt} -folder]     != "./subfolder/../" }   { puts "Error: Relative folder misdetected" }
37 if { [QAOsdPathPart {./subfolder/../file.txt} -fileName]   != "file.txt" }          { puts "Error: Relative file name misdetected" }
38 if { [QAOsdPathPart {../../file.txt} -folder]              != "../../" }            { puts "Error: Relative folder misdetected" }
39 if { [QAOsdPathPart {../../file.txt} -fileName]            != "file.txt" }          { puts "Error: Relative file name misdetected" }
40 if { [QAOsdPathPart {/home/username/file.txt} -folder]     != "/home/username/" }   { puts "Error: Unix folder misdetected" }
41 if { [QAOsdPathPart {/home/username/file.txt} -fileName]   != "file.txt" }          { puts "Error: Unix file name misdetected" }
42
43 if { [QAOsdPathPart {content://file.jpg} -folder]          != "content://" }        { puts "Error: Content folder misdetected" }
44 if { [QAOsdPathPart {content://file.jpg} -fileName]        != "file.jpg" }          { puts "Error: Content file name misdetected" }
45 if { [QAOsdPathPart {ftp://server.org/file.gif} -folder]   != "ftp://server.org/" } { puts "Error: Remote protocol folder misdetected" }
46 if { [QAOsdPathPart {ftp://server.org/file.gif} -fileName] != "file.gif" }          { puts "Error: Remote protocol file name misdetected" }
47 if { [QAOsdPathPart {\\?\UNC\server\file.zip} -folder]     != "\\\\?\\UNC\\server\\" } { puts "Error: UNC folder misdetected" }
48 if { [QAOsdPathPart {\\?\UNC\server\file.zip} -fileName]   != "file.zip" }          { puts "Error: UNC filename misdetected" }