summaryrefslogtreecommitdiff
path: root/test/typeof6.awk
blob: a1988c180c59bacfe1d9022bf37a277fa716c2d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

BEGIN{

	A[ "any index" ] = 1		# any number

	for ( i in A ) {

		v = A[ i ]

		gensub( /^/, "1", 1, v )

		#gsub( /^dfsdfs/, "1", v )

		#sub( /^/, "1", v )

		if ( typeof( A[ i ] ) == "unknown" )

			print "ERROR: A[ " i " ] == " A[ i ] "'" }

	v = A[ "any index" ]

	print typeof( v )

 }



# GNU Awk 5.1.0, API: 3.0 (GNU MPFR 3.1.5, GNU MP 6.1.2)
# Copyright (C) 1989, 1991-2020 Free Software Foundation.
#
# Windows 10x64
#
# here is the typeof() error reproducing script
# it is actual for: gensub(), gsub() and sub() built-ins
#
# please pay attention that: v = A[ i ] is doesn't matter
# you may apply built-ins at A[ i ] directly with the same
# result
#
# with Respect
#
# Denis Shirokov 					(2021.9.5)