@@ -316,6 +316,29 @@ def test_designaxis_model_parse_subspace_range_pass(qtbot):
316
316
# default value should match string
317
317
assert match [1 ] == passing_value [2 ]
318
318
319
+ negative_values = [
320
+ # negative values on slnt axis
321
+ ("-10:0" , (- 10.0 , 0.0 ), None ),
322
+ ("-10.0:0" , (- 10.0 , 0.0 ), None ),
323
+ ("-10 : 0" , (- 10.0 , 0.0 ), None ),
324
+ # mock negative max end using signed zero
325
+ ("-10:-0" , (- 10.0 , - 0.0 ), None ),
326
+ ("-10.0:-0.0" , (- 10.0 , - 0.0 ), None ),
327
+ ("-10.0 : -0.0" , (- 10.0 , - 0.0 ), None ),
328
+ # test negative default
329
+ ("-10:-0 [-5]" , (- 10.0 , - 0.0 ), "-5" ),
330
+ ("-10:-0 [ -5 ]" , (- 10.0 , - 0.0 ), "-5" ),
331
+ ("-10.0 : -0.0 [ -5.0 ]" , (- 10.0 , - 0.0 ), "-5.0" ),
332
+ ]
333
+
334
+ for negative_value in negative_values :
335
+ # switch to slnt axis for these tests
336
+ match = model .parse_subspace_range (negative_value [0 ], "slnt" )
337
+ # range should match tuple
338
+ assert match [0 ] == negative_value [1 ]
339
+ # default value should match string
340
+ assert match [1 ] == negative_value [2 ]
341
+
319
342
320
343
def test_designaxis_model_parse_subspace_range_fail_invalid_syntax (qtbot ):
321
344
tableview = QTableView ()
0 commit comments