r27
r1
1[[분류:테스트]][[분류:나무마크 문법]]
2[[../|상위 문서]]
r3
3[[../include 결과|결과 보기]]
r1
4== 변수 a=1 ==
r16
5===# a=1 계열 #===
r1
6if a=1 테스트
7{{{#!if a==1
8@a@ 그냥 a\=1 출력}}}
9----
10if a='1' 테스트
11{{{#!if a=='1'
12@a@ a\='1'출력}}}
13----
14if a="1" 테스트
15{{{#!if a=="1"
16@a@ a\="1"출력}}}
17----
18if a=\\1 테스트
19{{{#!if a==\1
20@a@ a\=\\1출력}}}
21----
22if calc(a)=1 테스트
23{{{#!if calc(a)==1
24@a@ \calc\(a)\=1출력}}}
r2
25----
r4
26if +calc(a)=1 테스트
27{{{#!if +calc(a)==1
28@a@ \+calc\(a)\=1출력}}}
29
r17
30===# +a=1 계열 #===
r2
31if +a=1 테스트
32{{{#!if +a==1
33출력 (+a=1)}}}
34----
35if +a='1' 테스트
36{{{#!if +a=='1'
37출력 (+a='1')}}}
38----
39if +a="1" 테스트
40{{{#!if +a=="1"
41출력 (+a="1")}}}
42----
43if -a=-1 테스트
44{{{#!if -a==-1
45출력 (-a=-1)}}}
r4
46
r16
47===# @@_@a@=1 계열 #===
r4
48if @@_@a@=1 테스트 :
49{{{#!if @a@==1
50@a@ \=1출력}}}
51----
52if @@_@a@='1' 테스트
53{{{#!if @a@=='1'
54@a@ \='1'출력}}}
55----
56if @@_@a@="1" 테스트
57{{{#!if @a@=="1"
58@a@ \="1"출력}}}
59----
60if @@_@a@=\\1 테스트
61{{{#!if @a@==\1
62@a@ \=\\1출력}}}
63----
64if @@_@a=1@ 테스트
65{{{#!if @a==1@
66@a@ \=@@_@1출력}}}
67----
68if @@_@a=1@=1 테스트
69{{{#!if @a=1@==1
70@a@ \=@@_@1출력}}}
71----
72if calc(@@_@a@)=1 테스트
73{{{#!if calc(@a@)==1
74@a@ \calc\()\=@@_@1출력}}}
75
76
r16
77===# +@@_@a@=1 계열 #===
r4
78if +@@_@a@=1 테스트 :
79{{{#!if +@a@==1
80@a@ \=1출력}}}
81----
82if +@@_@a@='1' 테스트
83{{{#!if +@a@=='1'
84@a@ \='1'출력}}}
85----
86if +@@_@a@="1" 테스트
87{{{#!if +@a@=="1"
88@a@ \="1"출력}}}
89----
90if +@@_@a@=\\1 테스트
91{{{#!if +@a@==\1
92@a@ \=\\1출력}}}
93----
94if +@@_@a=1@ 테스트
95{{{#!if +@a==1@
96@a@ \=@@_@1출력}}}
97----
98if +@@_@a=1@=1 테스트
99{{{#!if +@a=1@==1
100@a@ \=@@_@1출력}}}
101----
102if +calc(@@_@a@)=1 테스트
103{{{#!if +calc(@a@)==1
104@a@ \calc\()\=@@_@1출력}}}
r16
105
106==# 변수 b=text #==
r1
107if @@_@b@=text 테스트 :
108{{{#!if @b@==text
109@b@ \=text출력}}}
110----
111if @@_@b@= text 테스트 (스페이스바 1개)
112{{{#!if @b@== text
r5
113@b@ \= text출력}}}
114
r16
115==# 변수 c\= #==
r5
116null과 "" 다름 테스트.
117
118if c=null 테스트 :
119{{{#!if c==null
120출력 (c=null)}}}
121----
122if c="" 테스트 :
123{{{#!if c==""
124출력 (c="")}}}
125----
126if c={{{#gray ''(space)''}}} 테스트 :
127{{{#!if c==
r6
128출력 (c={{{#gray ''(space)''}}})}}}
r7
129----
r6
130if c="{{{#gray ''(space)''}}}" 테스트 :
131{{{#!if c==" "
r8
132출력 (c="{{{#gray ''(space)''}}}")}}}
133
r18
134== this 함수 ==
135===# this \[{{{#orange \'}}}{{{#green 변수명}}}{{{#orange \'}}}\] #===
r8
136this['true']=true 테스트
137{{{#!if this['true']==true
138출력 }}}
139----
r15
140a=b 테스트 : 아무 변수도 호출하지 않으면 null == null 상태가 된다.
r9
141{{{#!if a==b
r8
142출력}}}
143----
r15
144this['a']=this['b'] 테스트 : 아무 변수도 호출하지 않으면 "" == "" 상태가 된다.
r8
145{{{#!if this['a']==this['b']
146출력}}}
r9
147----
r22
148a+b=c 테스트 (먼저 숫자로 출력되는 변수들끼리 덧셈식이 올바르게 작동하는지를 검증하기 위한 테스트이다.)
r9
149{{{#!if a+b==c
150출력}}}
151----
152this['a']+this['b']=this['c'] 테스트
153{{{#!if this['a']+this['b']==this['c']
r11
154출력}}}
155----
r15
156+a+b=+c 테스트 : 아무 변수도 호출하지 않으면 nullnull == null 형식이 되는 것으로 추정된다.
r11
157{{{#!if +a+b==+c
158출력}}}
159----
r15
160(+a)+(+b)=+c 테스트 : 숫자값으로 연산하고자 +를 선언했으므로 괄호로 엮어야 한다.
r14
161{{{#!if (+a)+(+b)==+c
162출력}}}
163----
r16
164+this['a']+this['b']=+this['c'] 테스트 : 변수 호출하지 않으면 ++=상태가 된다.
r11
165{{{#!if +this['a']+this['b']==+this['c']
r16
166출력}}}
r18
167----
r16
168(+this['a'])+(+this['b'])=+this['c'] 테스트 : 변수 호출하지 않으면 ++=상태가 된다.
169{{{#!if +this['a']+this['b']==+this['c']
r18
170출력}}}
171
r24
172{{{#orange 결론 : }}} {{{#!wiki style="display: inline; font-family: monospace;"
r25
173this\[{{{#orange \'}}}{{{#green 변수명}}}{{{#orange \'}}}\]}}}는 텍스트 값으로 출력된다.
r24
174
r18
175===# this \[{{{#orange \+}}}{{{#green 변수명}}}\] #===
176{{{#!wiki style="display: inline; font-family: monospace;"
177this}}} 함수 안에 {{{#!wiki style="display: inline; font-family: monospace;"
r19
178{{{#orange \'}}}{{{#green 변수명}}}{{{#orange \'}}}}}} 이 변수를 텍스트 값으로 부르는 구문이라 가정한다면, {{{#!wiki style="display: inline; font-family: monospace;"
179this}}} 함수 안에 다른 모양을 넣고 테스트를 해보는 문단이다.
180이 문단에서는 {{{#!wiki style="display: inline; font-family: monospace;"
181this\[{{{#orange \+}}}{{{#green 변수명}}}\]}}} 형식을 테스트해본다.
r18
182----
183if this[+a]=1 테스트
184{{{#!if this[+a]==1
185출력}}}
186----
187if this[+a]='1' 테스트
188{{{#!if this[+a]=='1'
189출력}}}
190----
191if this[+a]="1" 테스트
192{{{#!if this[+a]=="1"
193출력}}}
194----
195if this[-a]=-1 테스트
196{{{#!if this[-a]==-1
197출력}}}
198
r21
199a=1 입력부분 결과를 보면 위의 식 4개 어디에도 출력이 나오지 않는다.
200
201{{{#orange 결론}}} : 실수값으로도 텍스트 값으로도 일치하지 않는 점에서 {{{#!wiki style="display: inline; font-family: monospace;"
202this\[{{{#orange \+}}}{{{#green 변수명}}}\]}}}은 올바른 입력이 아니다.
203
204===# this \[{{{#green 변수명}}}\] #===
205이 문단에서는 {{{#!wiki style="display: inline; font-family: monospace;"
206this\[{{{#green 변수명}}}\]}}} 형식을 테스트해본다.
207----
208if this[a]=1 테스트
209{{{#!if this[a]==1
210출력}}}
211----
212if this[a]='1' 테스트
213{{{#!if this[a]=='1'
214출력}}}
215----
216if this[a]="1" 테스트
217{{{#!if this[a]=="1"
218출력}}}
r22
219
220a=1 입력부분 결과를 보면 위의 식 3개 어디에도 출력이 나오지 않는다.
221
222{{{#orange 결론}}} : 실수값으로도 텍스트 값으로도 일치하지 않는 점에서 {{{#!wiki style="display: inline; font-family: monospace;"
r23
223this\[{{{#green 변수명}}}\]}}}도 올바른 입력이 아니다.
224
225===# this \[{{{#orange \"}}}{{{#green 변수명}}}{{{#orange \"}}}\] #===
226작은따옴표로 된다면 큰따옴표로는 되는지 테스트.
227if this["a"]=1 테스트
228{{{#!if this["a"]==1
229출력}}}
230----
231if this["a"]='1' 테스트
232{{{#!if this["a"]=='1'
233출력}}}
234----
235if this["a"]="1" 테스트
236{{{#!if this["a"]=="1"
r24
237출력}}}
238
239a=1 입력부분 결과를 보면 텍스트 값으로 출력이 나온다.
240
241{{{#orange 결론 :}}} {{{#!wiki style="display: inline; font-family: monospace;"
r25
242this\[{{{#orange \"}}}{{{#green 변수명}}}{{{#orange \"}}}\]}}}은 {{{#!wiki style="display: inline; font-family: monospace;"
r26
243this\[{{{#orange \'}}}{{{#green 변수명}}}{{{#orange \'}}}\]}}}와 마찬가지로 텍스트 값으로 출력된다.
244
r27
245===# this{{{#orange .}}}{{{#green 변수명}}} 테스트 #===
r26
246텍스트값으로만 될 수 있는지 테스트.
247
248기준모양 : this.a == 1
249---다음은 기출변형 표이다.---
r27
250|| 구분 || this.a || +this.a || -this.a || "this.a" || [this.a] ||
251|| a==1[* 단, -this.a 에는 -this.a==-1로 걸어놓음.] || {{{#!if this.a==1
r26
252출력}}} || {{{#!if +this.a==1
r27
253출력}}} || {{{#!if -this.a==-1
r26
254출력}}} || {{{#!if "this.a"==1
255출력}}} || {{{#!if [this.a]==1
256출력}}} ||
257|| a=='1' || {{{#!if this.a=='1'
258출력}}} || {{{#!if +this.a=='1'
r27
259출력}}} || {{{#!if -this.a=='1'
r26
260출력}}} || {{{#!if "this.a"=='1'
261출력}}} || {{{#!if [this.a]=='1'
262출력}}} ||
263|| a=="1" || {{{#!if this.a=="1"
264출력}}} || {{{#!if +this.a=="1"
r27
265출력}}} || {{{#!if -this.a=="1"
r26
266출력}}} || {{{#!if "this.a"=="1"
267출력}}} || {{{#!if [this.a]=="1"
268출력}}} ||
r27
269
270결과에서 a=1 문단 참조.
271{{{#orange 결론 :}}} {{{#!wiki style="display: inline; font-family: monospace;"
272this{{{#orange .}}}{{{#green 변수명}}}}}}은 양식만 잘 맞추면 숫자값으로 또는 텍스트값으로 나오게 할 수 있다.
r26
273