Exemple #1
0
 def _expand(self, str, local_vars={}):
     """Expand $vars in a string."""
     return ninja_syntax.expand(str, self.vars, local_vars)
Exemple #2
0
 def test_double(self):
     self.assertEqual('a b$c', ninja_syntax.expand('a$ b$$c', {}))
Exemple #3
0
 def _expand(self, str, local_vars={}):
     """Expand $vars in a string."""
     return ninja_syntax.expand(str, self.vars, local_vars)
Exemple #4
0
 def test_space(self):
     vars = {}
     self.assertEqual('x y z', ninja_syntax.expand('x$ y$ z', vars))
Exemple #5
0
 def test_locals(self):
     vars = {'x': 'a'}
     local_vars = {'x': 'b'}
     self.assertEqual('a', ninja_syntax.expand('$x', vars))
     self.assertEqual('b', ninja_syntax.expand('$x', vars, local_vars))
Exemple #6
0
 def test_var(self):
     vars = {'xyz': 'XYZ'}
     self.assertEqual('fooXYZ', ninja_syntax.expand('foo$xyz', vars))
Exemple #7
0
 def test_vars(self):
     vars = {'x': 'X', 'y': 'YYY'}
     self.assertEqual('XYYY', ninja_syntax.expand('$x$y', vars))
Exemple #8
0
 def test_double(self):
     self.assertEqual('a b$c', ninja_syntax.expand('a$ b$$c', {}))
Exemple #9
0
 def test_basic(self):
     vars = {'x': 'X'}
     self.assertEqual('foo', ninja_syntax.expand('foo', vars))
Exemple #10
0
 def test_locals(self):
     vars = {'x': 'a'}
     local_vars = {'x': 'b'}
     self.assertEqual('a', ninja_syntax.expand('$x', vars))
     self.assertEqual('b', ninja_syntax.expand('$x', vars, local_vars))
Exemple #11
0
 def test_space(self):
     vars = {}
     self.assertEqual('x y z', ninja_syntax.expand('x$ y$ z', vars))
Exemple #12
0
 def test_vars(self):
     vars = {'x': 'X', 'y': 'YYY'}
     self.assertEqual('XYYY', ninja_syntax.expand('$x$y', vars))
Exemple #13
0
 def test_var(self):
     vars = {'xyz': 'XYZ'}
     self.assertEqual('fooXYZ', ninja_syntax.expand('foo$xyz', vars))
Exemple #14
0
 def test_basic(self):
     vars = {'x': 'X'}
     self.assertEqual('foo', ninja_syntax.expand('foo', vars))