|
80 | 80 | ('%s', '%d' % nowsecs, 'seconds since the Epoch in UCT'), |
81 | 81 | ('%3y', '%03d' % (now[0]%100), |
82 | 82 | 'year without century rendered using fieldwidth'), |
| 83 | + ('%n', '\n', 'newline character'), |
| 84 | + ('%t', '\t', 'tab character'), |
83 | 85 | ) |
84 | 86 |
|
85 | 87 | if verbose: |
86 | 88 | print "Strftime test, platform: %s, Python version: %s" % \ |
87 | 89 | (sys.platform, string.split(sys.version)[0]) |
88 | | - expectations = expectations + nonstandard_expectations |
89 | 90 |
|
90 | 91 | for e in expectations: |
91 | 92 | result = time.strftime(e[0], now) |
92 | 93 | if result == e[1]: continue |
93 | 94 | if result[0] == '%': |
94 | | - print "Does not appear to support '%s' format" % e[0] |
| 95 | + print "Does not support standard '%s' format (%s)" % (e[0], e[2]) |
95 | 96 | else: |
96 | 97 | print "Conflict for %s (%s):" % (e[0], e[2]) |
97 | 98 | print " Expected %s, but got %s" % (e[1], result) |
| 99 | + |
| 100 | +for e in nonstandard_expectations: |
| 101 | + result = time.strftime(e[0], now) |
| 102 | + if result == e[1]: |
| 103 | + if verbose: |
| 104 | + print "Supports nonstandard '%s' format (%s)" % (e[0], e[2]) |
| 105 | + elif result[0] == '%': |
| 106 | + if verbose: |
| 107 | + print "Does not appear to support '%s' format" % e[0] |
| 108 | + else: |
| 109 | + if verbose: |
| 110 | + print "Conflict for %s (%s):" % (e[0], e[2]) |
| 111 | + print " Expected %s, but got %s" % (e[1], result) |
0 commit comments