assert e.get_implicit() == None
assert e.render(m) == "- - - -"
+ # Check backward compatability with pre-0.07 format:
+ e = SCons.Sig.SConsignEntry(m, "- - - ")
+ assert e.timestamp == None
+ assert e.csig == None
+ assert e.bsig == None
+ assert e.get_implicit() == []
+ assert e.render(m) == "- - - \0\0\0\0"
+
+ # Check backward compatability with pre-0.07 format:
+ e = SCons.Sig.SConsignEntry(m, "- - -")
+ assert e.timestamp == None
+ assert e.csig == None
+ assert e.bsig == None
+ assert e.get_implicit() == None
+ assert e.render(m) == "- - - -"
+
+ e = SCons.Sig.SConsignEntry(m, "- - - \0\0\0\0")
+ assert e.timestamp == None
+ assert e.csig == None
+ assert e.bsig == None
+ assert e.get_implicit() == []
+ assert e.render(m) == "- - - \0\0\0\0"
+
+ # Check backward compatability with pre-0.08 format:
e = SCons.Sig.SConsignEntry(m, "- - - foo\0bar")
assert e.timestamp == None
assert e.csig == None
assert e.bsig == None
assert e.get_implicit() == ['foo', 'bar']
- assert e.render(m) == "- - - foo\0bar"
+ assert e.render(m) == "- - - \0\0foo\0bar\0\0"
- e = SCons.Sig.SConsignEntry(m, "123 456 789 foo bletch\0bar")
+ e = SCons.Sig.SConsignEntry(m, "- - - \0\0foo\0bar\0\0")
+ assert e.timestamp == None
+ assert e.csig == None
+ assert e.bsig == None
+ assert e.get_implicit() == ['foo', 'bar']
+ assert e.render(m) == "- - - \0\0foo\0bar\0\0"
+
+ e = SCons.Sig.SConsignEntry(m, "123 456 789 \0\0foo bletch\0bar\0\0")
assert e.timestamp == 123
assert e.bsig == 456
assert e.csig == 789
assert e.get_implicit() == ['foo bletch', 'bar']
- assert e.render(m) == "123 456 789 foo bletch\0bar"
+ assert e.render(m) == "123 456 789 \0\0foo bletch\0bar\0\0"
+ # Check backward compatability with pre-0.07 format:
e = SCons.Sig.SConsignEntry(m, "987 654 321")
assert e.timestamp == 987
assert e.bsig == 654
assert e.csig == 321
- assert e.get_implicit() == []
- assert e.render(m) == "987 654 321 " # note trailing space
+ assert e.get_implicit() == None
+ assert e.render(m) == "987 654 321 -"
- e.set_implicit(None)
+ e.set_implicit(None)
assert e.get_implicit() == None, e.get_implicit()
- e.set_implicit('')
+ e.set_implicit('')
assert e.get_implicit() == [], e.get_implicit()
- e.set_implicit('foo')
+ e.set_implicit('foo')
assert e.get_implicit() == ['foo'], e.get_implicit()
- e.set_implicit('foo bar')
+ e.set_implicit('foo bar')
assert e.get_implicit() == ['foo bar'], e.get_implicit()
- e.set_implicit(['foo'])
+ e.set_implicit(['foo'])
assert e.get_implicit() == ['foo'], e.get_implicit()
- e.set_implicit(['foo bar'])
+ e.set_implicit(['foo bar'])
assert e.get_implicit() == ['foo bar'], e.get_implicit()
- e.set_implicit(['foo', 'bar'])
+ e.set_implicit(['foo', 'bar'])
assert e.get_implicit() == ['foo', 'bar'], e.get_implicit()
class SConsignFileTestCase(unittest.TestCase):
if arr[2] == '-': self.csig = None
else: self.csig = module.from_string(arr[2])
- if len(arr) < 4: self.implicit = ''
- elif arr[3] == '-': self.implicit = None
- else: self.implicit = arr[3]
+ if len(arr) < 4: self.implicit = None # pre-0.07 format
+ elif arr[3] == '': self.implicit = '' # pre-0.08 format
+ elif arr[3] == '-': self.implicit = None
+ else: self.implicit = string.replace(arr[3], '\0\0', '')
except IndexError:
pass
else: csig = module.to_string(self.csig)
if self.implicit is None: implicit = '-'
- else: implicit = self.implicit
+ else: implicit = '\0\0%s\0\0'%self.implicit
return '%s %s %s %s' % (timestamp, bsig, csig, implicit)
if implicit is None:
self.implicit = None
else:
- if SCons.Util.is_String(implicit):
- implicit = [implicit]
+ if SCons.Util.is_String(implicit):
+ implicit = [implicit]
self.implicit = string.join(map(str, implicit), '\0')