support/testing/tests/package/test_tcl.py: new runtime test
Signed-off-by: Julien Olivain <ju.o@free.fr> [Arnout: use f-string instead of string.format] Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
This commit is contained in:
committed by
Arnout Vandecappelle
parent
47cbcb70d0
commit
2031fc8809
11
support/testing/tests/package/test_tcl/rootfs-overlay/root/factorial.tcl
Executable file
11
support/testing/tests/package/test_tcl/rootfs-overlay/root/factorial.tcl
Executable file
@@ -0,0 +1,11 @@
|
||||
#! /usr/bin/env tclsh
|
||||
|
||||
proc factorial {n} {
|
||||
set f 1
|
||||
for {set i 1} {$i <= $n} {incr i} {
|
||||
set f [expr {$f * $i}]
|
||||
}
|
||||
return $f
|
||||
}
|
||||
|
||||
puts [factorial [lindex $argv 0]]
|
||||
Reference in New Issue
Block a user