changeset 13142:e9827c85c50b

progress: test setting progress.width This also makes the tests readable in a 80-character terminal which is why I made the change to both tests.
author Martin Geisler <mg@aragost.com>
date Wed, 15 Dec 2010 16:35:09 +0100
parents 6cfe17c19ba2
children c2e55c21db27
files tests/test-convert-svn-move.t tests/test-progress.t
diffstat 2 files changed, 80 insertions(+), 78 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-convert-svn-move.t	Wed Dec 15 16:29:46 2010 +0100
+++ b/tests/test-convert-svn-move.t	Wed Dec 15 16:35:09 2010 +0100
@@ -168,70 +168,71 @@
   > assume-tty = 1
   > delay = 0
   > refresh = 0
+  > width = 60
   > EOF
 
   $ hg convert svn-repo hg-progress 2>&1 | $TESTDIR/filtercr.py
   
-  scanning [ <=>                                                              ] 1
-  scanning [  <=>                                                             ] 2
-  scanning [   <=>                                                            ] 3
-  scanning [    <=>                                                           ] 4
-  scanning [     <=>                                                          ] 5
-  scanning [      <=>                                                         ] 6
-  scanning [       <=>                                                        ] 7
-                                                                                  
-  converting [                                                              ] 0/7
-  getting files [========>                                                  ] 1/6
-  getting files [==================>                                        ] 2/6
-  getting files [============================>                              ] 3/6
-  getting files [======================================>                    ] 4/6
-  getting files [================================================>          ] 5/6
-  getting files [==========================================================>] 6/6
-                                                                                  
-  converting [=======>                                                      ] 1/7
-  scanning paths [                                                          ] 0/1
-  getting files [==========================================================>] 1/1
-                                                                                  
-  converting [================>                                             ] 2/7
-  scanning paths [                                                          ] 0/2
-  scanning paths [============================>                             ] 1/2
-  getting files [=============>                                             ] 1/4
-  getting files [============================>                              ] 2/4
-  getting files [===========================================>               ] 3/4
-  getting files [==========================================================>] 4/4
-                                                                                  
-  converting [=========================>                                    ] 3/7
-  scanning paths [                                                          ] 0/1
-  getting files [==========================================================>] 1/1
-                                                                                  
-  converting [==================================>                           ] 4/7
-  scanning paths [                                                          ] 0/1
-  getting files [==========================================================>] 1/1
-                                                                                  
-  converting [===========================================>                  ] 5/7
-  scanning paths [                                                          ] 0/3
-  scanning paths [==================>                                       ] 1/3
-  scanning paths [=====================================>                    ] 2/3
-  getting files [======>                                                    ] 1/8
-  getting files [=============>                                             ] 2/8
-  getting files [=====================>                                     ] 3/8
-  getting files [============================>                              ] 4/8
-  getting files [===================================>                       ] 5/8
-  getting files [===========================================>               ] 6/8
-  getting files [==================================================>        ] 7/8
-  getting files [==========================================================>] 8/8
-                                                                                  
-  converting [====================================================>         ] 6/7
-  scanning paths [                                                          ] 0/1
-  getting files [======>                                                    ] 1/8
-  getting files [=============>                                             ] 2/8
-  getting files [=====================>                                     ] 3/8
-  getting files [============================>                              ] 4/8
-  getting files [===================================>                       ] 5/8
-  getting files [===========================================>               ] 6/8
-  getting files [==================================================>        ] 7/8
-  getting files [==========================================================>] 8/8
-                                                                                  
+  scanning [ <=>                                          ] 1
+  scanning [  <=>                                         ] 2
+  scanning [   <=>                                        ] 3
+  scanning [    <=>                                       ] 4
+  scanning [     <=>                                      ] 5
+  scanning [      <=>                                     ] 6
+  scanning [       <=>                                    ] 7
+                                                              
+  converting [                                          ] 0/7
+  getting files [=====>                                 ] 1/6
+  getting files [============>                          ] 2/6
+  getting files [==================>                    ] 3/6
+  getting files [=========================>             ] 4/6
+  getting files [===============================>       ] 5/6
+  getting files [======================================>] 6/6
+                                                              
+  converting [=====>                                    ] 1/7
+  scanning paths [                                      ] 0/1
+  getting files [======================================>] 1/1
+                                                              
+  converting [===========>                              ] 2/7
+  scanning paths [                                      ] 0/2
+  scanning paths [==================>                   ] 1/2
+  getting files [========>                              ] 1/4
+  getting files [==================>                    ] 2/4
+  getting files [============================>          ] 3/4
+  getting files [======================================>] 4/4
+                                                              
+  converting [=================>                        ] 3/7
+  scanning paths [                                      ] 0/1
+  getting files [======================================>] 1/1
+                                                              
+  converting [=======================>                  ] 4/7
+  scanning paths [                                      ] 0/1
+  getting files [======================================>] 1/1
+                                                              
+  converting [=============================>            ] 5/7
+  scanning paths [                                      ] 0/3
+  scanning paths [===========>                          ] 1/3
+  scanning paths [========================>             ] 2/3
+  getting files [===>                                   ] 1/8
+  getting files [========>                              ] 2/8
+  getting files [=============>                         ] 3/8
+  getting files [==================>                    ] 4/8
+  getting files [=======================>               ] 5/8
+  getting files [============================>          ] 6/8
+  getting files [=================================>     ] 7/8
+  getting files [======================================>] 8/8
+                                                              
+  converting [===================================>      ] 6/7
+  scanning paths [                                      ] 0/1
+  getting files [===>                                   ] 1/8
+  getting files [========>                              ] 2/8
+  getting files [=============>                         ] 3/8
+  getting files [==================>                    ] 4/8
+  getting files [=======================>               ] 5/8
+  getting files [============================>          ] 6/8
+  getting files [=================================>     ] 7/8
+  getting files [======================================>] 8/8
+                                                              
   initializing destination hg-progress repository
   scanning source...
   sorting...
--- a/tests/test-progress.t	Wed Dec 15 16:29:46 2010 +0100
+++ b/tests/test-progress.t	Wed Dec 15 16:35:09 2010 +0100
@@ -28,6 +28,7 @@
   $ echo "loop=`pwd`/loop.py" >> $HGRCPATH
   $ echo "[progress]" >> $HGRCPATH
   $ echo "assume-tty=1" >> $HGRCPATH
+  $ echo "width=60" >> $HGRCPATH
 
 test default params, display nothing because of delay
 
@@ -40,10 +41,10 @@
 
   $ hg -y loop 3 2>&1 | $TESTDIR/filtercr.py
   
-  loop [                                                                    ] 0/3
-  loop [=====================>                                              ] 1/3
-  loop [============================================>                       ] 2/3
-                                                                                  \r (esc)
+  loop [                                                ] 0/3
+  loop [===============>                                ] 1/3
+  loop [===============================>                ] 2/3
+                                                              \r (esc)
 
 test refresh is taken in account
 
@@ -57,37 +58,37 @@
   
   0/2 loop lo
   1/2 loop lo
-                                                                                  \r (esc)
+                                                              \r (esc)
 
 test format options 2
 
   $ hg -y --config 'progress.format=number item-3 bar' loop 2 2>&1 \
   > | $TESTDIR/filtercr.py
   
-  0/2 p.0 [                                                                     ]
-  1/2 p.1 [=================================>                                   ]
-                                                                                  \r (esc)
+  0/2 p.0 [                                                 ]
+  1/2 p.1 [=======================>                         ]
+                                                              \r (esc)
 
 test format options and indeterminate progress
 
   $ hg -y --config 'progress.format=number item bar' loop -- -2 2>&1 \
   > | $TESTDIR/filtercr.py
   
-  0 loop.0               [ <=>                                                  ]
-  1 loop.1               [  <=>                                                 ]
-                                                                                  \r (esc)
+  0 loop.0               [ <=>                              ]
+  1 loop.1               [  <=>                             ]
+                                                              \r (esc)
 
 make sure things don't fall over if count > total
 
   $ hg -y loop --total 4 6 2>&1 | $TESTDIR/filtercr.py
   
-  loop [                                                                    ] 0/4
-  loop [================>                                                   ] 1/4
-  loop [=================================>                                  ] 2/4
-  loop [==================================================>                 ] 3/4
-  loop [===================================================================>] 4/4
-  loop [ <=>                                                                ] 5/4
-                                                                                  \r (esc)
+  loop [                                                ] 0/4
+  loop [===========>                                    ] 1/4
+  loop [=======================>                        ] 2/4
+  loop [===================================>            ] 3/4
+  loop [===============================================>] 4/4
+  loop [ <=>                                            ] 5/4
+                                                              \r (esc)
 
 test immediate progress completion