mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Improvements to scons build for beast.
* Common code extracted to Python directories. * Read ~/.scons file for scons environment defaults. * Override scons settings with shell environment variables. * New "tags" for debug, nodebug, optimize, nooptimize builds. * Universal platform detection. * Default value of environment variables set through prefix dictionaries. * Check for correct Boost value and fail otherwise. * Extract git describe --tags into a preprocesor variable, -DTIP_BRANCH * More colors - blue for unchanged defaults, green for changed defaults, red for error. * Contain unit tests for non-obvious stuff. * Check to see that boost libraries have been built. * Right now, we accept both .dylib and .a versions but it'd be easy to enforce .a only.
This commit is contained in:
committed by
Vinnie Falco
parent
4a3176e3a0
commit
6b0cec1189
36
python/beast/util/String_test.py
Normal file
36
python/beast/util/String_test.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
from beast.util import String
|
||||
from beast.util import Terminal
|
||||
|
||||
Terminal.CAN_CHANGE_COLOR = False
|
||||
|
||||
class String_test(TestCase):
|
||||
def test_comments(self):
|
||||
self.assertEqual(String.remove_comment(''), '')
|
||||
self.assertEqual(String.remove_comment('#'), '')
|
||||
self.assertEqual(String.remove_comment('# a comment'), '')
|
||||
self.assertEqual(String.remove_comment('hello # a comment'), 'hello ')
|
||||
self.assertEqual(String.remove_comment(
|
||||
r'hello \# not a comment # a comment'),
|
||||
'hello # not a comment ')
|
||||
|
||||
def test_remove_quotes(self):
|
||||
errors = []
|
||||
self.assertEqual(String.remove_quotes('hello', print=errors.append),
|
||||
'hello')
|
||||
self.assertEqual(String.remove_quotes('"hello"', print=errors.append),
|
||||
'hello')
|
||||
self.assertEqual(String.remove_quotes('hello"', print=errors.append),
|
||||
'hello"')
|
||||
self.assertEqual(errors, [])
|
||||
|
||||
def test_remove_quotes_error(self):
|
||||
errors = []
|
||||
self.assertEqual(String.remove_quotes('"hello', print=errors.append),
|
||||
'hello')
|
||||
self.assertEqual(errors,
|
||||
['WARNING: line started with " but didn\'t end with one:',
|
||||
'"hello'])
|
||||
Reference in New Issue
Block a user