Home
last modified time | relevance | path

Searched refs:foo (Results 1 – 25 of 437) sorted by relevance

12345678910>>...18

/onnv-gate/usr/src/cmd/perl/5.8.4/distrib/t/op/
H A Ddelete.t7 $foo{1} = 'a';
8 $foo{2} = 'b';
9 $foo{3} = 'c';
10 $foo{4} = 'd';
11 $foo{5} = 'e';
13 $foo = delete $foo{2};
15 if ($foo eq 'b') {print "ok 1\n";} else {print "not ok 1 $foo\n";}
16 unless (exists $foo{2}) {print "ok 2\n";} else {print "not ok 2 $foo{2}\n";}
17 if ($foo{1} eq 'a') {print "ok 3\n";} else {print "not ok 3\n";}
18 if ($foo{3} eq 'c') {print "ok 4\n";} else {print "not ok 4\n";}
[all …]
H A Dvec.t7 print vec($foo,0,1) == 0 ? "ok 1\n" : "not ok 1\n";
8 print length($foo) == 0 ? "ok 2\n" : "not ok 2\n";
9 vec($foo,0,1) = 1;
10 print length($foo) == 1 ? "ok 3\n" : "not ok 3\n";
11 print unpack('C',$foo) == 1 ? "ok 4\n" : "not ok 4\n";
12 print vec($foo,0,1) == 1 ? "ok 5\n" : "not ok 5\n";
14 print vec($foo,20,1) == 0 ? "ok 6\n" : "not ok 6\n";
15 vec($foo,20,1) = 1;
16 print vec($foo,20,1) == 1 ? "ok 7\n" : "not ok 7\n";
17 print length($foo) == 3 ? "ok 8\n" : "not ok 8\n";
[all …]
H A Darray.t39 @foo = ();
42 $foo[0] = '0';
45 $foo[2] = '2';
71 $foo = 'now is the time';
72 if (($F1,$F2,$Etc) = ($foo =~ /^(\S+)\s+(\S+)\s*(.*)/)) {
84 $foo = 'lskjdf';
85 if ($cnt = (($F1,$F2,$Etc) = ($foo =~ /^(\S+)\s+(\S+)\s*(.*)/))) {
92 %foo = ('blurfl','dyick','foo','bar','etc.','etc.');
93 %bar = %foo;
97 (%bar,$a,$b) = (%foo,'how','now');
[all …]
H A Dclosure.t27 sub foo { $i = shift if @_; $i } subroutine
30 test { foo == 1 };
31 foo(2);
32 test { foo == 2 };
35 my $foo = sub {$i = shift if @_; $i };
37 test {&$foo() == 2 };
38 &$foo(3);
39 test {&$foo() == 3 };
41 test { foo == 3 and $i == 3};
51 $foo = bar(4);
[all …]
H A Drange.t14 @foo = (1,2,3,4,5,6,7,8,9);
15 @foo[2..4] = ('c','d','e');
17 print join(':',@foo[$foo[0]..5]) eq '2:c:d:e:6' ? "ok 2\n" : "not ok 2\n";
117 @foo=(); push @foo, $_ for undef..2;
118 print join(":", @foo) eq '0:1:2' ? "ok 29\n" : "not ok 29\n";
120 @foo=(); push @foo, $_ for -2..undef;
121 print join(":", @foo) eq '-2:-1:0' ? "ok 30\n" : "not ok 30\n";
123 @foo=(); push @foo, $_ for undef..'2';
124 print join(":", @foo) eq '0:1:2' ? "ok 31\n" : "not ok 31\n";
126 @foo=(); push @foo, $_ for '-2'..undef;
[all …]
H A Dgv.t17 $foo = 'foo';
18 $bar = *main::foo;
19 $bar = $foo;
21 $foo = *main::bar;
25 if ($foo) {
26 print ref(\$foo) eq 'GLOB' ? "ok 2\n" : "not ok 2\n";
29 unless ($foo =~ /abcd/) {
30 print ref(\$foo) eq 'GLOB' ? "ok 3\n" : "not ok 3\n";
33 if ($foo eq '*main::bar') {
34 print ref(\$foo) eq 'GLOB' ? "ok 4\n" : "not ok 4\n";
[all …]
H A Dref.t15 $foo = "ok 2\n";
17 local(*foo) = *bar;
18 print $foo;
20 print $foo;
23 $foo = "ok 4\n";
25 local(*foo) = 'baz';
26 print $foo;
28 print $foo;
30 $foo = "ok 6\n";
32 local(*foo);
[all …]
H A Dundef.t53 sub foo { print "ok 19\n"; } subroutine
55 &foo || print "not ok 19\n";
57 print defined &foo ? "ok 20\n" : "not ok 20\n";
58 undef &foo;
59 print defined(&foo) ? "not ok 21\n" : "ok 21\n";
69 tie my %foo, 'Tie::StdHash';
70 print defined %foo ? "ok 24\n" : "not ok 24\n";
71 %foo = ( a => 1 );
72 print defined %foo ? "ok 25\n" : "not ok 25\n";
77 tie my @foo, 'Tie::StdArray';
[all …]
H A Dlocal.t5 sub foo { subroutine
20 print &foo("ok 1\n","ok 2\n");
58 local($a[1]) = 'foo';
60 print +($a[1] eq 'foo') ? "" : "not ", "ok 24\n";
77 local($h{'a'}) = 'foo';
79 print +($h{'a'} eq 'foo') ? "" : "not ", "ok 30\n";
118 local($a[1]) = 'foo';
120 print +($a[1] eq 'foo') ? "" : "not ", "ok 37\n";
143 local($h{'a'}) = 'foo';
147 print +($h{'a'} eq 'foo') ? "" : "not ", "ok 42\n";
[all …]
/onnv-gate/usr/src/lib/libshell/common/tests/
H A Darrays.sh89 unset foo
93 foo=''
100 unset foo
101 foo[0]=foo
102 foo[3]=bar
103 unset foo[0]
104 unset foo[3]
108 unset foo
109 foo[3]=bar
110 foo[0]=foo
[all …]
H A Dnameref.sh36 nameref foo=$1 bar=$2
37 if [[ $foo != $bar ]]
38 then err_exit "foo=$foo != bar=$bar"
40 foo=hello
41 if [[ $foo != $bar ]]
42 then err_exit "foo=$foo != bar=$bar"
44 foo.child=child
45 if [[ ${foo.child} != ${bar.child} ]]
54 .foo=top
55 .foo.bar=next
[all …]
H A Dcomvar.sh38 nameref foo=p
39 if [[ ${foo.x} != ${Point.x} ]]
42 unset foo
64 x=( [foo]=bar )
68 unset -n foo x
69 unset foo x
70 foo=( x=3)
71 nameref x=foo
72 if [[ ${!x.@} != foo.x ]]
79 x.foo.bar=7
[all …]
H A Dattributes.sh90 x=$(foo=abc $SHELL <<!
91 foo=bar
104 readonly $a=foo
105 if [[ $b != foo ]]
135 unset -f foo
136 function foo function
143 foo 1
147 foo
153 unset foo
154 foo=bar
[all …]
H A Dfunctions.sh36 integer foo=33
42 1) print -r - "$foo" "$bar";;
44 3) typeset foo=foo
46 print -r - "$foo" "$bar";;
48 typeset foo=20;;
68 if [[ $(bar=foo foobar 1) != '33 foo' ]]
71 if [[ $bar == foo ]]
80 if [[ $foo != 36 ]]
114 unset -f foo
115 function foo function
[all …]
H A Dcase.sh32 bam=foo[3]
34 do foo=0
36 foo1) foo=1;;
37 $bar) foo=2;;
38 $bam) foo=3;;
39 foo[4]) foo=4;;
41 foo=5;;
43 foo=6;;
45 if [[ $i != foo$foo ]]
80 ') == foo.h ]] || err_exit "optimizer bug"
H A Dalias.sh34 alias foo='print hello' alias
35 if [[ $(foo) != hello ]]
38 if [[ $(foo world) != 'hello world' ]]
41 alias foo='print hello ' alias
43 if [[ $(foo bar) != 'hello world' ]]
46 if [[ $(foo \bar) != 'hello bar' ]]
56 unalias foo || err_exit "unalias foo failed"
57 alias foo 2> /dev/null && err_exit "alias for non-existent alias foo returns true"
61 if [[ $(bar) != foo ]]
73 alias foo=echo alias
[all …]
H A Dquoting2.sh100 set -- ${x+foo bar bam}
104 set -- ${x+foo "bar bam"}
108 set -- ${x+foo 'bar bam'}
114 then err_exit '${x+foo $x bam} does not yield three arguments'
118 then err_exit '${x+foo "$x" bam} does not yield three arguments'
130 then err_exit '${x+foo "$x "bam} does not yield two arguments'
166 then err_exit '`eval print \\${foo$x}`' not working
198 [[ "${foo}$" == 'foo$' ]] || err_exit 'foo=foo;"${foo}$" != foo$'
199 [[ "${foo}${foo}$" == 'foofoo$' ]] || err_exit 'foo=foo;"${foo}${foo}$" != foofoo$'
201 [[ "$foo" == ~(Elr)(\\\$|#)\ ]] || err_exit $'\'$ \' not matching RE \\\\\\$|#\''
[all …]
/onnv-gate/usr/src/cmd/perl/5.8.4/distrib/lib/
H A DInternals.t12 my $foo;
13 my @foo;
14 my %foo;
16 ok( !Internals::SvREADONLY $foo );
17 ok( Internals::SvREADONLY $foo, 1 );
18 ok( Internals::SvREADONLY $foo );
19 ok( !Internals::SvREADONLY $foo, 0 );
20 ok( !Internals::SvREADONLY $foo );
22 ok( !Internals::SvREADONLY @foo );
23 ok( Internals::SvREADONLY @foo, 1 );
[all …]
/onnv-gate/usr/src/cmd/dtrace/test/tst/common/funcs/
H A Dtst.basename.d.out4 echo "basename(\"/foo/bar/baz\") is \"baz\"; expected \"`basename "/foo/bar/baz"`"\"
7 if [ `dirname "/foo/bar/baz"` != "/foo/bar" ]; then
8 echo "dirname(\"/foo/bar/baz\") is \"/foo/bar\"; expected \"`dirname "/foo/bar/baz"`"\"
11 if [ `basename "/foo/bar///baz/"` != "baz" ]; then
12 echo "basename(\"/foo/bar///baz/\") is \"baz\"; expected \"`basename "/foo/bar///baz/"`"\"
15 if [ `dirname "/foo/bar///baz/"` != "/foo/bar" ]; then
16 echo "dirname(\"/foo/bar///baz/\") is \"/foo/bar\"; expected \"`dirname "/foo/bar///baz/"`"\"
19 if [ `basename "/foo/bar/baz/"` != "baz" ]; then
20 echo "basename(\"/foo/bar/baz/\") is \"baz\"; expected \"`basename "/foo/bar/baz/"`"\"
23 if [ `dirname "/foo/bar/baz/"` != "/foo/bar" ]; then
[all …]
H A Dtst.cleanpath.d.out1 cleanpath("/foo/bar/baz") = "/foo/bar/baz"
2 cleanpath("/foo/bar///baz/") = "/foo/bar/baz/"
3 cleanpath("/foo/bar/baz/") = "/foo/bar/baz/"
4 cleanpath("/foo/bar/baz//") = "/foo/bar/baz/"
5 cleanpath("/foo/bar/baz/.") = "/foo/bar/baz/."
6 cleanpath("/foo/bar/baz/./") = "/foo/bar/baz/"
7 cleanpath("/foo/bar/../../baz/.//") = "/baz/"
8 cleanpath("foo/bar/./././././baz/") = "foo/bar/baz/"
9 cleanpath("/foo/bar/baz/../../../../../../") = "/"
12 cleanpath("/foo/bar/baz/../../bop/bang/../../bar/baz/") = "/foo/bar/baz/"
/onnv-gate/usr/src/cmd/perl/5.8.4/distrib/lib/Test/Simple/t/
H A DMore.t25 isn't("foo", "bar", 'foo isn\'t bar');
54 my $foo = bless([0], 'Foo');
55 ok( ! $foo->can('bar') );
56 ok( ! $foo->isa('bar') );
57 $foo->[0] = 1;
58 can_ok( $foo, 'blah');
59 isa_ok( $foo, 'blah');
67 ok( eq_hash({ foo => 42, bar => 23 }, {bar => 23, foo => 42}),
74 {foo => 23, bar => 42},
81 {foo => 23, bar => 42},
[all …]
/onnv-gate/usr/src/cmd/perl/5.8.4/distrib/t/base/
H A Dlex.t33 $foo = int($foo * 100 + .5);
34 if ($foo eq 2591024652) {print "ok 7\n";} else {print "not ok 7 :$foo:\n";}
40 $foo = 'ok 9';
42 $foo
50 $foo = 'ok 11';
52 $foo
79 foo
86 foo
91 $foo = FOO;
93 $foo{$bar} = BAZ;
[all …]
/onnv-gate/usr/src/cmd/perl/5.8.4/distrib/t/cmd/
H A Dfor.t25 $foo = 3210;
27 foreach $foo (@ary) {
28 $foo *= 2;
41 $foo .= $_;
43 if ($foo eq '3210abcde') {print "ok 5\n";} else {print "not ok 5 $foo\n";}
45 foreach $foo (("ok 6\n","ok 7\n")) {
46 print $foo;
49 sub foo { subroutine
55 print foo(1) == 1 ? "ok" : "not ok", " 8\n";
56 print foo(2) == 2 ? "ok" : "not ok", " 9\n";
[all …]
/onnv-gate/usr/src/cmd/perl/5.8.4/distrib/lib/File/
H A DCopy.t31 $foo = <F>;
37 print "not " unless $foo eq sprintf "ok %d\n", 3+$loopconst;
46 open(R, "copy-$$") or die "open copy-$$: $!"; $foo = <R>; close(R);
47 print "not " unless $foo eq sprintf "ok %d\n", 3+$loopconst;
53 open(R, "copy-$$") or die; $foo = <R>; close(R) or die "close: $!";
54 print "not " unless $foo eq sprintf "ok %d\n", 3+$loopconst;
63 open(R, "copy-$$") or die; $foo = <R>; close(R);
64 print "# foo=`$foo'\nnot " unless $foo eq sprintf "ok %d\n", 3+$loopconst;
72 open(R, "copy-$$") or die; $foo = <R>; close(R);
73 print "not " unless $foo eq sprintf "ok %d\n", 3+$loopconst;
[all …]
/onnv-gate/usr/src/cmd/dtrace/demo/vars/
H A Dclause.d28 this int foo; /* an integer clause-local variable */ variable
35 this->foo = (me % 3 == 0) ? 10 : this->foo;
36 printf("Clause 1 is number %d; foo is %d\n", me++ % 3, this->foo++);
44 this->foo = (me % 3 == 0) ? 20 : this->foo;
45 printf("Clause 2 is number %d; foo is %d\n", me++ % 3, this->foo++);
53 this->foo = (me % 3 == 0) ? 30 : this->foo;
54 printf("Clause 3 is number %d; foo is %d\n", me++ % 3, this->foo++);

12345678910>>...18