⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 format.test

📁 linux系统下的音频通信
💻 TEST
📖 第 1 页 / 共 2 页
字号:
} {      12.346}test format-6.2 {various syntax features} {    format "%0*.*f" 12 3 12.345678901} {00000012.346}test format-6.3 {various syntax features} {    format "\*\t\\n"} {*	\n}test format-7.1 {error conditions} {    catch format} 1test format-7.2 {error conditions} {    catch format msg    set msg} {wrong # args: should be "format formatString ?arg arg ...?"}test format-7.3 {error conditions} {    catch {format %*d}} 1test format-7.4 {error conditions} {    catch {format %*d} msg    set msg} {not enough arguments for all format specifiers}test format-7.5 {error conditions} {    catch {format %*.*f 12}} 1test format-7.6 {error conditions} {    catch {format %*.*f 12} msg    set msg} {not enough arguments for all format specifiers}test format-7.7 {error conditions} {    catch {format %*.*f 12 3}} 1test format-7.8 {error conditions} {    catch {format %*.*f 12 3} msg    set msg} {not enough arguments for all format specifiers}test format-7.9 {error conditions} {    list [catch {format %*d x 3} msg] $msg} {1 {expected integer but got "x"}}test format-7.10 {error conditions} {    list [catch {format %*.*f 2 xyz 3} msg] $msg} {1 {expected integer but got "xyz"}}test format-7.11 {error conditions} {    catch {format %d 2a}} 1test format-7.12 {error conditions} {    catch {format %d 2a} msg    set msg} {expected integer but got "2a"}test format-7.13 {error conditions} {    catch {format %c 2x}} 1test format-7.14 {error conditions} {    catch {format %c 2x} msg    set msg} {expected integer but got "2x"}test format-7.15 {error conditions} {    catch {format %f 2.1z}} 1test format-7.16 {error conditions} {    catch {format %f 2.1z} msg    set msg} {expected floating-point number but got "2.1z"}test format-7.17 {error conditions} {    catch {format ab%}} 1test format-7.18 {error conditions} {    catch {format ab% 12} msg    set msg} {format string ended in middle of field specifier}test format-7.19 {error conditions} {    catch {format %q x}} 1test format-7.20 {error conditions} {    catch {format %q x} msg    set msg} {bad field specifier "q"}test format-7.21 {error conditions} {    catch {format %d}} 1test format-7.22 {error conditions} {    catch {format %d} msg    set msg} {not enough arguments for all format specifiers}test format-7.23 {error conditions} {    catch {format "%d %d" 24 xyz} msg    set msg} {expected integer but got "xyz"}test format-8.1 {long result} {    set a {1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 1 2 3 4 5 6 7 8 9 0 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z}    format {1111 2222 3333 4444 5555 6666 7777 8888 9999 aaaa bbbb cccc dddd eeee ffff gggg hhhh iiii jjjj kkkk llll mmmm nnnn oooo pppp qqqq rrrr ssss tttt uuuu vvvv wwww xxxx yyyy zzzz AAAA BBBB CCCC DDDD EEEE FFFF GGGG %s %s} $a $a} {1111 2222 3333 4444 5555 6666 7777 8888 9999 aaaa bbbb cccc dddd eeee ffff gggg hhhh iiii jjjj kkkk llll mmmm nnnn oooo pppp qqqq rrrr ssss tttt uuuu vvvv wwww xxxx yyyy zzzz AAAA BBBB CCCC DDDD EEEE FFFF GGGG 1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 1 2 3 4 5 6 7 8 9 0 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 1 2 3 4 5 6 7 8 9 0 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z}test format-9.1 {"h" format specifier} {nonPortable} {    format %hd 0xffff} -1test format-9.2 {"h" format specifier} {nonPortable} {    format %hx 0x10fff} ffftest format-9.3 {"h" format specifier} {nonPortable} {    format %hd 0x10000} 0test format-10.1 {XPG3 %$n specifiers} {    format {%2$d %1$d} 4 5} {5 4}test format-10.2 {XPG3 %$n specifiers} {    format {%2$d %1$d %1$d %3$d} 4 5 6} {5 4 4 6}test format-10.3 {XPG3 %$n specifiers} {    list [catch {format {%2$d %3$d} 4 5} msg] $msg} {1 {"%n$" argument index out of range}}test format-10.4 {XPG3 %$n specifiers} {    list [catch {format {%2$d %0$d} 4 5 6} msg] $msg} {1 {"%n$" argument index out of range}}test format-10.5 {XPG3 %$n specifiers} {    list [catch {format {%d %1$d} 4 5 6} msg] $msg} {1 {cannot mix "%" and "%n$" conversion specifiers}}test format-10.6 {XPG3 %$n specifiers} {    list [catch {format {%2$d %d} 4 5 6} msg] $msg} {1 {cannot mix "%" and "%n$" conversion specifiers}}test format-10.7 {XPG3 %$n specifiers} {    list [catch {format {%2$d %3d} 4 5 6} msg] $msg} {1 {cannot mix "%" and "%n$" conversion specifiers}}test format-10.8 {XPG3 %$n specifiers} {    format {%2$*d %3$d} 1 10 4} {         4 4}test format-10.9 {XPG3 %$n specifiers} {    format {%2$.*s %4$d} 1 5 abcdefghijklmnop 44} {abcde 44}test format-10.10 {XPG3 %$n specifiers} {    list [catch {format {%2$*d} 4} msg] $msg} {1 {"%n$" argument index out of range}}test format-10.11 {XPG3 %$n specifiers} {    list [catch {format {%2$*d} 4 5} msg] $msg} {1 {"%n$" argument index out of range}}test format-10.12 {XPG3 %$n specifiers} {    list [catch {format {%2$*d} 4 5 6} msg] $msg} {0 {    6}}test format-11.1 {negative width specifiers} {    format "%*d" -47 25} {25}test format-12.1 {tcl_precision fuzzy comparison} {    catch {unset a}    catch {unset b}    catch {unset c}    catch {unset d}    set a 0.0000000000001    set b 0.00000000000001    set c 0.00000000000000001    set d [expr $a + $b + $c]    format {%0.10f %0.12f %0.15f %0.17f} $d $d $d $d} {0.0000000000 0.000000000000 0.000000000000110 0.00000000000011001}test format-12.2 {tcl_precision fuzzy comparison} {    catch {unset a}    catch {unset b}    catch {unset c}    catch {unset d}    set a 0.000000000001    set b 0.000000000000005    set c 0.0000000000000008    set d [expr $a + $b + $c]    format {%0.10f %0.12f %0.15f %0.17f} $d $d $d $d} {0.0000000000 0.000000000001 0.000000000001006 0.00000000000100580}test format-12.3 {tcl_precision fuzzy comparison} {    catch {unset a}    catch {unset b}    catch {unset c}    set a 0.00000000000099    set b 0.000000000000011    set c [expr $a + $b]    format {%0.10f %0.12f %0.15f %0.17f} $c $c $c $c} {0.0000000000 0.000000000001 0.000000000001001 0.00000000000100100}test format-12.4 {tcl_precision fuzzy comparison} {    catch {unset a}    catch {unset b}    catch {unset c}    set a 0.444444444444    set b 0.33333333333333    set c [expr $a + $b]    format {%0.10f %0.12f %0.15f %0.16f} $c $c $c $c} {0.7777777778 0.777777777777 0.777777777777330 0.7777777777773300}test format-12.5 {tcl_precision fuzzy comparison} {    catch {unset a}    catch {unset b}    catch {unset c}    set a 0.444444444444    set b 0.99999999999999    set c [expr $a + $b]    format {%0.10f %0.12f %0.15f} $c $c $c} {1.4444444444 1.444444444444 1.444444444443990}test format-13.1 {testing MAX_FLOAT_SIZE for 0 and 1} {    format {%s} ""} {}test format-13.2 {testing MAX_FLOAT_SIZE for 0 and 1} {    format {%s} "a"} {a}set a "0123456789"set b ""for {set i 0} {$i < 290} {incr i} {    append b $a}for {set i 290} {$i < 400} {incr i} {    test format-14.[expr $i -290] {testing MAX_FLOAT_SIZE} {        format {%s} $b        } $b    append b "x"}catch {unset a}catch {unset b}catch {unset c}catch {unset d}return

⌨️ 快捷键说明

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