Mentions légales du service

Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • vidjil/should
1 result
Show changes
Commits on Source (4)
# The --extra option allows to add something after the first word every command.
./should -v --extra You demo/hello.should ; true
$ 'You' is added right after 'echo'
: echo You hello, world
./should -v --extra They demo/no.should ; true
$ 'They' is not added because of NO_EXTRA
0: echo They hello, world
\ No newline at end of file
# A !NO_EXTRA directive tell to ignore any --extra arguments.
# See demo/extra.should
!NO_EXTRA:
echo hello, world
$ No extra arguments were given to `echo`
r1:^hello, world$
......@@ -57,6 +57,7 @@ RE_TEST = re.compile('^(\S)*[:]')
DIRECTIVE_REQUIRES = '!REQUIRES:'
DIRECTIVE_NO_LAUNCHER = '!NO_LAUNCHER:'
DIRECTIVE_SCRIPT = '!LAUNCH:'
DIRECTIVE_NO_EXTRA = '!NO_EXTRA:'
DIRECTIVE_OPTIONS = '!OPTIONS:'
DIRECTIVE_SOURCE = '!OUTPUT_FILE:'
DIRECTIVE_EXIT_CODE = '!EXIT_CODE:'
......@@ -676,6 +677,11 @@ class TestSuite():
self.use_launcher = False
continue
# Directive -- No extra options
if l.startswith(DIRECTIVE_NO_EXTRA):
self.variables = [(VAR_EXTRA, '')] + self.variables
continue
# Directive -- Source
if l.startswith(DIRECTIVE_SOURCE):
self.source = os.path.join(self.cd if self.cd else '', l[len(DIRECTIVE_SOURCE):].strip())
......