mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0023275: restore command set name of result variable incorrectly if absolute path is used
Command restore corrected to set default name of the shape equal to filename without extension Test case added (demo draw restore)
This commit is contained in:
parent
3d8969b13b
commit
1598ec0e46
@ -281,7 +281,10 @@ proc save {name {file ""}} {
|
||||
help save {save variable [filename]} "DRAW Variables management"
|
||||
|
||||
proc restore {file {name ""}} {
|
||||
if {$name == ""} {set name $file}
|
||||
if {$name == ""} {
|
||||
# if name is not given explicitly, use name of the file w/o extension
|
||||
set name [file rootname [file tail $file]]
|
||||
}
|
||||
global Draw_DataDir
|
||||
uplevel #0 "brestore [file join $Draw_DataDir $file ] $name"
|
||||
return $name
|
||||
|
10
tests/demo/draw/restore
Normal file
10
tests/demo/draw/restore
Normal file
@ -0,0 +1,10 @@
|
||||
# check that restore command defines default name for the loaded shape
|
||||
# as base name of the file without extension
|
||||
|
||||
restore [locate_data_file CCV-POUR-COPIER-COLLER.brep]
|
||||
|
||||
if { ! [regexp {is a shape} [whatis CCV-POUR-COPIER-COLLER]] } {
|
||||
puts "Error: no shape with name CCV-POUR-COPIER-COLLER after restore"
|
||||
}
|
||||
|
||||
puts "TEST COMPLETED"
|
Loading…
x
Reference in New Issue
Block a user