MCPcopy Create free account
hub / github.com/vispy/vispy / test_FunctionChain

Function test_FunctionChain

vispy/visuals/shaders/tests/test_function.py:400–430  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

398
399
400def test_FunctionChain():
401
402 f1 = Function("void f1(){}")
403 f2 = Function("void f2(){}")
404 f3 = Function("float f3(vec3 x){}")
405 f4 = Function("vec3 f4(vec3 y){}")
406 f5 = Function("vec3 f5(vec4 z){}")
407
408 ch = FunctionChain('chain', [f1, f2])
409 assert ch.name == 'chain'
410 assert ch.args == []
411 assert ch.rtype == 'void'
412
413 assert_in('f1', ch.compile())
414 assert_in('f2', ch.compile())
415
416 ch.remove(f2)
417 assert_not_in('f2', ch.compile())
418
419 ch.append(f2)
420 assert_in('f2', ch.compile())
421
422 ch = FunctionChain(funcs=[f5, f4, f3])
423 assert_equal('float', ch.rtype)
424 assert_equal([('vec4', 'z')], ch.args)
425 assert_in('f3', ch.compile())
426 assert_in('f4', ch.compile())
427 assert_in('f5', ch.compile())
428 assert_in(f3, ch.dependencies())
429 assert_in(f4, ch.dependencies())
430 assert_in(f5, ch.dependencies())
431
432
433def test_StatementList():

Callers

nothing calls this directly

Calls 9

removeMethod · 0.95
appendMethod · 0.95
FunctionClass · 0.90
FunctionChainClass · 0.90
assert_inFunction · 0.90
assert_not_inFunction · 0.90
assert_equalFunction · 0.90
dependenciesMethod · 0.80
compileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…