Skip to contentSkip to conversation

tools/nextid: pad 0 in next test id seq number

PATCH In review Eryu Guan 2 participants 2 messages Jan 24, 2017

lore
Share & tools
lore

Eryu Guan

author
#0 lore raw

PATCH 1/1 tools/nextid: pad 0 in next test id seq number

nextid returns the next available seq number, but it doesn't pad id number with 0, e.g.

./tools/nextid ext4
23

After the fix it returns:

./tools/nextid ext4
023

This eases the process of moving tests around in a script.

---
 tools/sort-group | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/sort-group +1 -1
index 84944ed..6fcaad7 100755
@@ -103,7 +103,7 @@ def nextid_main():
 		xid = startid
 		while xid in xkeys:
 			xid += 1
-		print('%s/%d' % (group, xid))
+		print('%s/%03d' % (group, xid))
 
 if __name__ == '__main__':
 	if 'nextid' in sys.argv[0]:
Signature · 1 line
2.9.3