Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite4f6fa1

Browse files
committed
Fix tokenizer test harness to not decode tests multiple times.
Given a double escaped test, if it had multiple initial states, thesame test object would be decoded multiple times: this led to bogusresults on every run except the first.
1 parenta0415f2 commite4f6fa1

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

‎html5lib/tests/test_tokenizer.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,6 @@ def decode(inp):
144144
defrunTokenizerTest(test):
145145
warnings.resetwarnings()
146146
warnings.simplefilter("error")
147-
#XXX - move this out into the setup function
148-
#concatenate all consecutive character tokens into a single token
149-
if'doubleEscaped'intest:
150-
test=unescape(test)
151147

152148
expected=concatenateCharacterTokens(test['output'])
153149
if'lastStartTag'notintest:
@@ -183,10 +179,10 @@ def testTokenizer():
183179
testName=os.path.basename(filename).replace(".test","")
184180
if'tests'intests:
185181
forindex,testinenumerate(tests['tests']):
186-
#Skip tests with a self closing flag
187-
skip=False
188182
if'initialStates'notintest:
189183
test["initialStates"]= ["Data state"]
184+
if'doubleEscaped'intest:
185+
test=unescape(test)
190186
forinitialStateintest["initialStates"]:
191187
test["initialState"]=capitalize(initialState)
192188
yieldrunTokenizerTest,test

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp