tests/test-command-template.t
changeset 38265 41ae9b3cbfb9
parent 38243 06d11cd90516
child 38267 fb874fc1d9b4
equal deleted inserted replaced
38264:fbb2eddea4d2 38265:41ae9b3cbfb9
  3272   $ hg log -R latesttag -r3 -T '{min(tags % "{tag}")}\n'
  3272   $ hg log -R latesttag -r3 -T '{min(tags % "{tag}")}\n'
  3273   at3
  3273   at3
  3274   $ hg log -R latesttag -r3 -T '{max(tags % "{tag}")}\n'
  3274   $ hg log -R latesttag -r3 -T '{max(tags % "{tag}")}\n'
  3275   t3
  3275   t3
  3276 
  3276 
       
  3277 Test min/max of strings:
       
  3278 
       
  3279   $ hg log -R latesttag -l1 -T '{min(desc)}\n'
       
  3280   3
       
  3281   $ hg log -R latesttag -l1 -T '{max(desc)}\n'
       
  3282   t
       
  3283 
       
  3284 Test min/max of non-iterable:
       
  3285 
       
  3286   $ hg debugtemplate '{min(1)}'
       
  3287   hg: parse error: 1 is not iterable
       
  3288   (min first argument should be an iterable)
       
  3289   [255]
       
  3290   $ hg debugtemplate '{max(2)}'
       
  3291   hg: parse error: 2 is not iterable
       
  3292   (max first argument should be an iterable)
       
  3293   [255]
       
  3294 
       
  3295 Test min/max of empty sequence:
       
  3296 
       
  3297   $ hg debugtemplate '{min("")}'
       
  3298   hg: parse error: empty string
       
  3299   (min first argument should be an iterable)
       
  3300   [255]
       
  3301   $ hg debugtemplate '{max("")}'
       
  3302   hg: parse error: empty string
       
  3303   (max first argument should be an iterable)
       
  3304   [255]
       
  3305   $ hg debugtemplate '{min(dict())}'
       
  3306   hg: parse error: empty sequence
       
  3307   (min first argument should be an iterable)
       
  3308   [255]
       
  3309   $ hg debugtemplate '{max(dict())}'
       
  3310   hg: parse error: empty sequence
       
  3311   (max first argument should be an iterable)
       
  3312   [255]
       
  3313   $ hg debugtemplate '{min(dict() % "")}'
       
  3314   hg: parse error: empty sequence
       
  3315   (min first argument should be an iterable)
       
  3316   [255]
       
  3317   $ hg debugtemplate '{max(dict() % "")}'
       
  3318   hg: parse error: empty sequence
       
  3319   (max first argument should be an iterable)
       
  3320   [255]
       
  3321 
  3277 Test min/max of if() result
  3322 Test min/max of if() result
  3278 
  3323 
  3279   $ cd latesttag
  3324   $ cd latesttag
  3280   $ hg log -l1 -T '{min(if(true, revset("9:10"), ""))}\n'
  3325   $ hg log -l1 -T '{min(if(true, revset("9:10"), ""))}\n'
  3281   9
  3326   9