core_typecheck.py

来自「Boost provides free peer-reviewed portab」· Python 代码 · 共 48 行

PY
48
字号
#!/usr/bin/python# Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # This tests the typechecking facilities.import BoostBuildt = BoostBuild.Tester(pass_toolset=0)t.write("file.jam", """module .typecheck {    rule [path] ( x )    {        if ! [ MATCH "^(::)" : $(x) ]         {            ECHO "Error: $(x) is not a path" ;            return true ;        }    }}rule do ( [path] a ){}do $(ARGUMENT) ;actions dummy { } dummy all ;""")t.run_build_system("-ffile.jam -sARGUMENT=::a/b/c")t.run_build_system("-ffile.jam -sARGUMENT=a/b/c", status=1,                   stdout="""Error: a/b/c is not a pathfile.jam:18: in module scope*** argument error* rule do ( [path] a )* called with: ( a/b/c )* true afile.jam:16:see definition of rule 'do' being called""")t.cleanup()

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?