TestCasePackager.py is a verbatim port of TestCasePackager.ps1. The

rationale behind the addition of this file is it's meant to replace
TestCasePackager.ps1 outright and will be runnable on all major
operating systems.  There's still a bit of cleanup work needed as
the Python port was hardly optimized for the language.

A few side effects of this change:
- it now takes under ten seconds to generate the test262 website (PS
  version was taking over a minute)
- generated *.json files are ~5% smaller in size (PS was forcing
  '\r\n' and the Python version preserves the tests' newlines whether
  they're '\r\n' or '\n')
This commit is contained in:
David Fugate 2011-03-23 10:37:21 -07:00
parent 2282dfba34
commit 61343f1b93
77 changed files with 398 additions and 75 deletions

View File

@ -0,0 +1,323 @@
import argparse
import os
import sys
import xml.dom.minidom
import base64
import datetime
import shutil
import re
max_tests_per_json = 1000
parser = argparse.ArgumentParser(description='Tool used to generate the test262 website')
parser.add_argument('version', action='store',
help='Version of the test suite.')
args = parser.parse_args()
cur_path = os.path.dirname(os.path.realpath(__file__))
test262_root = os.path.join(cur_path, "..", "..")
test262_root = os.path.abspath(test262_root)
root_dir = os.path.join(test262_root, "test", "suite")
web_root_path = os.path.join(test262_root, "website", "resources", "scripts", "testcases")
web_root_path_on_server = "resources/scripts/testcases/"
exclude_list_filename = os.path.join(test262_root, "test", "config", "excludelist.xml")
test_harness_dir = os.path.join(test262_root, "test", "harness")
test_harness_website_dir = os.path.join(test262_root, "website", "resources", "scripts", "global")
test_harness_files = [x for x in os.listdir(test_harness_dir) if x.endswith(".js")]
#--Sanity checks--------------------------------------------------------------#
if not os.path.exists(root_dir):
print "Cannot generate (JSON) test262 tests when the path containing said tests, root_dir, does not exist!"
sys.exit(1)
if not os.path.exists(web_root_path):
print "Cannot generate (JSON) test262 tests to 'web_root_path' when it does not exist!"
sys.exit(1)
if not os.path.exists(exclude_list_filename):
print "Cannot generate (JSON) test262 tests without a file, exclude_list_filename, showing which tests have been disabled!"
sys.exit(1)
if not hasattr(args, "version"):
print "A test262 suite version must be specified to run this script!"
sys.exit(1)
if len(test_harness_files) < 3:
print "There are less than five test harness files under test_harness_dir. Something must be wrong!"
sys.exit(1)
#--Globals--------------------------------------------------------------------#
#Directories under "test\suite\" containing ES5 test chapter directories
#with *.js tests underneath them
contribution_dirs = ["sputnik_converted", "ietestcenter"]
#a list of all ES5 test chapter directories
chapters = []
#------------------------------------------------------------------------------
def getJSCount(dirName):
retVal = 0
if os.path.isfile(dirName) and dirName.endswith(".js"):
retVal = 1
elif os.path.isdir(dirName):
tempList = [os.path.join(dirName, x) for x in os.listdir(dirName)]
for x in tempList:
retVal += getJSCount(x)
else:
raise Exception("getJSCount: encountered a non-file/non-dir!")
return retVal
#------------------------------------------------------------------------------
def dirWalker(dirName):
#First check to see if it has test files directly inside it
temp = [os.path.join(dirName, x) for x in os.listdir(dirName) if not os.path.isdir(os.path.join(dirName, x))]
if len(temp)!=0:
chapters.append(dirName)
return
#Next check to see if all *.js files under this directory exceed our max
#for a JSON file
temp = getJSCount(dirName)
if temp==0:
print "ERROR: expected there to be JavaScript tests under dirName!"
sys.exit(1)
elif temp < max_tests_per_json:
chapters.append(dirName)
return
else:
#Max has been exceeded. We need to look at each subdir individually
temp = os.listdir(dirName)
for tempSubdir in temp:
dirWalker(os.path.join(dirName, tempSubdir))
#------------------------------------------------------------------------------
for tempDirName in contribution_dirs:
if not os.path.exists(os.path.join(root_dir, tempDirName)):
print "The expected ES5 test directory, root_dir\$tempDirName, did not exist!"
sys.exit(1)
dirWalker(os.path.join(root_dir, tempDirName))
num_tests=0
#total number of tests accross the entire set of tests.
total_num_tests=0
excludeList = xml.dom.minidom.parse(exclude_list_filename)
excludeList = excludeList.getElementsByTagName("test")
excludeList = [x.getAttribute("id") for x in excludeList]
#--HELPERS---------------------------------------------------------------------
multilineComment = False
def isTestStarted(line):
#Note this is a naive approach on the sense that "/*abc*/" could be on one
#line. However, we know for a fact this is not the case in IE Test Center
#or Sputnik tests.
global multilineComment
if multilineComment and ("*/" in line): #End of a newline comment
multilineComment = False
return False
elif "/*" in line: #Beginning of a newline comment
multilineComment = True
return False
elif multilineComment: #//we're already in a multi-line comment that hasn't ended
return False
elif "//" in line: #//blah
return False
elif re.match("^\s*$", line)!=None: #newlines
return False
elif "ES5Harness" in line: #definitely start of the test!
return True
return True
#--MAIN------------------------------------------------------------------------
#add quotes around a string to package it in JSON
def Encode(tstr):
return '"' + str(tstr) + '"'
#the following functions open and close json dictionary and array
def OpenDict():
return "{"
def CloseDict(d):
return d + "}"
def OpenArray():
return "["
def CloseArray(a):
return a + "]"
#add a node to an open dictionary. If it is first, do not add a comma.
#Some json parsers are sensitive and won't parse if the last element has a comma at the end
def AddDictNode(d, n, IsFirst):
if IsFirst:
o = d+n
else:
o = d + "," + n
return o
#add a node to an open array
def AddArrayElement(a, n, IsFirst):
if IsFirst:
o = a + n
else:
o = a + "," + n
return o
#this creates a dictionary node for a given key and value which is non-string
def CreateNode(k, v):
t = Encode(k)
return t + ":" + str(v)
# a similar node except where the value is a string
def CreateStringNode(a, b):
t1 = Encode(a)
t2 = Encode(b)
return t1 + ":" + t2
#TODO...
def IsNullOrEmpty(str):
if (str):
return False
else:
return True
testSuite = OpenArray()
count = 0
def getAllJSFiles(dirName):
retVal = []
for fullPath,dontCare,files in os.walk(dirName):
retVal += [os.path.join(fullPath,b) for b in files if b.endswith(".js")]
return retVal
for chapter in chapters:
chapterName = chapter.rsplit(os.path.sep, 1)[1]
print "Generating test cases for ES5 chapter:", chapterName
#create dictionaries for all our tests and a section
testsList = OpenDict()
sect = OpenDict()
sectionName ="Chapter - " + chapterName
sectionNameNode = CreateStringNode("name", sectionName)
#create an array for tests in a chapter
tests = OpenArray()
sourceFiles = getAllJSFiles(chapter)
if len(sourceFiles)!=0:
excluded=0
testCount = 0
for test in sourceFiles:
testName=test.rsplit(".", 1)[0] #12.4.6
testName=testName.rsplit(os.path.sep, 1)[1]
if excludeList.count(testName)==0:
# dictionary for each test
testDict = OpenDict()
idNode = CreateStringNode("id", testName)
#id node is our first node in the test dictionary
testDict = AddDictNode(testDict, idNode, True)
tempFile = open(test, "r")
scriptCode = tempFile.readlines()
tempFile.close()
scriptCodeContent=""
#Rip out license headers that add unnecessary bytes to the JSON'ized test cases
inBeginning = True
multilineComment = False
for line in scriptCode:
if inBeginning:
isStarted = isTestStarted(line)
if not isStarted:
continue
inBeginning = False
scriptCodeContent += line
if scriptCodeContent=="":
print "WARNING (" + test + "): unable to strip comments/license header/etc."
scriptCodeContent = "".join(scriptCode)
scriptCodeContent = base64.b64encode(scriptCodeContent)
codeNode = CreateStringNode("code", scriptCodeContent)
#add the test encoded code node to our test dictionary
testDict = AddDictNode(testDict, codeNode, False)
#now close the dictionary for the test
testDict = CloseDict(testDict)
#this adds the test to our tests array. Should we add a comma or not
if testCount==0:
tests = AddArrayElement(tests, testDict, True)
else:
tests = AddArrayElement(tests, testDict, False)
testCount += 1
else:
excluded = excluded + 1
#we have completed our tests. Close the tests array
tests = CloseArray(tests)
testsNode = CreateNode ("tests", tests)
num_tests = str(len(sourceFiles)-excluded)
#number of tests in our chapter. Create a node
num_testsNode = CreateStringNode("numTests", num_tests)
# add sectiopn node, number of tests and the tests themselves.
sect = AddDictNode(sect, sectionNameNode, True)
sect = AddDictNode(sect, num_testsNode, False)
sect = AddDictNode(sect, testsNode, False)
#close the section dictionary node
sect = CloseDict(sect)
#create a node for the tests and add it to our testsLists
testCollectionNode = CreateNode("testsCollection", sect)
testsList = AddDictNode(testsList, testCollectionNode, True)
testsList = CloseDict(testsList)
testGroupPathname = web_root_path + os.path.sep + chapterName + ".json"
#if you want to use jsmin to minimize the .json file, use the 2nd line. Otherwise 1st
with open(testGroupPathname, "w") as f:
f.write(testsList)
#add the name of the chapter test to our complete list
filename = web_root_path_on_server + chapterName + ".json"
filenameEnc = Encode(filename)
if count==0:
testSuite = AddArrayElement(testSuite, filenameEnc, True)
else:
testSuite = AddArrayElement(testSuite, filenameEnc, False)
count += 1
total_num_tests += len(sourceFiles) - excluded
#we now have the list of files for each chapter. Close that array
testSuite = CloseArray(testSuite)
#create a root node for our suite
testSuiteRoot = OpenDict()
#create a node for total number of tests across all chapters
total_num_testsNode = CreateNode("numTests", total_num_tests)
#create suiteversion node
args.versionEnc = Encode(args.version)
args.versionNode = CreateNode("version", args.versionEnc)
#create a date node
dateStr = str(datetime.datetime.now().date())
dateEnc = Encode(dateStr)
dateNode = CreateNode("date", dateEnc)
#add the nodes to our suites dictionary
testSuiteRoot = AddDictNode(testSuiteRoot,total_num_testsNode, True)
testSuiteRoot = AddDictNode(testSuiteRoot, args.versionNode, False)
testSuiteRoot = AddDictNode(testSuiteRoot, dateNode, False)
testSuiteNode = CreateNode("testSuite", testSuite)
testSuiteRoot = AddDictNode(testSuiteRoot, testSuiteNode, False)
#close the testsuite and write it to the root file
testSuiteRoot = CloseDict(testSuiteRoot)
testcaseslistPathName = web_root_path + os.path.sep + "testcaseslist.json"
with open(testcaseslistPathName, "w") as f:
f.write(testSuiteRoot)
#Deploy test harness to website as well
print ""
print "Deploying test harness files to 'test_harness_website_dir'..."
for filename in test_harness_files:
shutil.copy(os.path.join(test_harness_dir, filename),
os.path.join(test_harness_website_dir, filename))
print "Done."

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"testsCollection":{"name":"Chapter - 15.1","numTests":"5","tests":[{"id":"15.1.1.1-0","code":"dmFyIGdsb2JhbCA9IHRoaXM7DQoNCg0KRVM1SGFybmVzcy5yZWdpc3RlclRlc3Qo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dGVzdGNhc2UoKSB7DQogICAgICAgIHJldHVybiBpc05hTihwYXJzZUZsb2F0KCIiKSkgJiYgcGFyc2VGbG9hdCgiIikgIT09IHBhcnNlRmxvYXQoIiIpOw0KICAgIH0sDQoNCiAgICBwcmVjb25kaXRpb246IGZ1bmN0aW9uIHByZXJlcSgpIHsNCiAgICAgICAgcmV0dXJuIHRydWU7DQogICAgfQ0KfSk7DQo="}]}}
{"testsCollection":{"name":"Chapter - 15.1","numTests":"5","tests":[{"id":"15.1.1.1-0","code":"dmFyIGdsb2JhbCA9IHRoaXM7CgoKRVM1SGFybmVzcy5yZWdpc3RlclRlc3QoIHsKaWQ6ICIxNS4xLjEuMS0wIiwKCnBhdGg6ICJUZXN0Q2FzZXMvY2hhcHRlcjE1LzE1LjEvMTUuMS4xLzE1LjEuMS4xLzE1LjEuMS4xLTAuanMiLAoKZGVzY3JpcHRpb246ICJHbG9iYWwuTmFOIGlzIGEgZGF0YSBwcm9wZXJ0eSB3aXRoIGRlZmF1bHQgYXR0cmlidXRlIHZhbHVlcyAoZmFsc2UpIiwKCnRlc3Q6IGZ1bmN0aW9uIHRlc3RjYXNlKCkgewogIHZhciBkZXNjID0gT2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcihnbG9iYWwsICdOYU4nKTsKICBpZiAoZGVzYy53cml0YWJsZSA9PT0gZmFsc2UgJiYKICAgICAgZGVzYy5lbnVtZXJhYmxlID09PSBmYWxzZSAmJgogICAgICBkZXNjLmNvbmZpZ3VyYWJsZSA9PT0gZmFsc2UpIHsKICAgIHJldHVybiB0cnVlOwogIH0KIH0sCgpwcmVjb25kaXRpb246IGZ1bmN0aW9uIHByZXJlcSgpIHsKICByZXR1cm4gZm5FeGlzdHMoT2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcik7CiB9Cn0pOwo="},{"id":"15.1.1.2-0","code":"dmFyIGdsb2JhbCA9IHRoaXM7CgoKRVM1SGFybmVzcy5yZWdpc3RlclRlc3QoI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MS5qcyIsCgogICAgZGVzY3JpcHRpb246ICJwYXJlc2VGbG9hdCAtICd0cmltbWVkU3RyaW5nJyBpcyB0aGUgZW1wdHkgc3RyaW5nIHdoZW4gaW5wdXRTdHJpbmcgZG9lcyBub3QgY29udGFpbiBhbnkgc3VjaCBjaGFyYWN0ZXJzIiwKCiAgICB0ZXN0OiBmdW5jdGlvbiB0ZXN0Y2FzZSgpIHsKICAgICAgICByZXR1cm4gaXNOYU4ocGFyc2VGbG9hdCgiIikpICYmIHBhcnNlRmxvYXQoIiIpICE9PSBwYXJzZUZsb2F0KCIiKTsKICAgIH0sCgogICAgcHJlY29uZGl0aW9uOiBmdW5jdGlvbiBwcmVyZXEoKSB7CiAgICAgICAgcmV0dXJuIHRydWU7CiAgICB9Cn0pOwo="}]}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"testsCollection":{"name":"Chapter - 15.2.3.1","numTests":"1","tests":[{"id":"15.2.3.1","code":"RVM1SGFybmVzcy5yZWdpc3RlclRlc3QoIHsNCmlkOiAiMTUuMi4zLjEiLA0KDQpwYXRoOiAiVGVzdENhc2VzL2NoYXB0ZXIxNS8xNS4yLzE1LjIuMy8xNS4yLjMuMS8xNS4yLjMuMS5qcyIsDQoNCmRlc2NyaXB0aW9uOiAiT2JqZWN0LnByb3RvdHlwZSBpcyBhIGRhdGEgcHJvcGVydHkgd2l0aCBkZWZhdWx0IGF0dHJpYnV0ZSB2YWx1ZXMgKGZhbHNlKSIsDQoNCnRlc3Q6IGZ1bmN0aW9uIHRlc3RjYXNlKCkgew0KICB2YXIgZGVzYyA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoT2JqZWN0LCAncHJvdG90eXBlJyk7DQogIGlmIChkZXNjLndyaXRhYmxlID09PSBmYWxzZSAmJg0KICAgICAgZGVzYy5lbnVtZXJhYmxlID09PSBmYWxzZSAmJg0KICAgICAgZGVzYy5jb25maWd1cmFibGUgPT09IGZhbHNlKSB7DQogICAgcmV0dXJuIHRydWU7DQogIH0NCiB9LA0KDQpwcmVjb25kaXRpb246IGZ1bmN0aW9uIHByZXJlcSgpIHsNCiAgcmV0dXJuIGZuRXhpc3RzKE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IpOw0KIH0NCn0pOw0K"}]}}
{"testsCollection":{"name":"Chapter - 15.2.3.1","numTests":"1","tests":[{"id":"15.2.3.1","code":"RVM1SGFybmVzcy5yZWdpc3RlclRlc3QoIHsKaWQ6ICIxNS4yLjMuMSIsCgpwYXRoOiAiVGVzdENhc2VzL2NoYXB0ZXIxNS8xNS4yLzE1LjIuMy8xNS4yLjMuMS8xNS4yLjMuMS5qcyIsCgpkZXNjcmlwdGlvbjogIk9iamVjdC5wcm90b3R5cGUgaXMgYSBkYXRhIHByb3BlcnR5IHdpdGggZGVmYXVsdCBhdHRyaWJ1dGUgdmFsdWVzIChmYWxzZSkiLAoKdGVzdDogZnVuY3Rpb24gdGVzdGNhc2UoKSB7CiAgdmFyIGRlc2MgPSBPYmplY3QuZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKE9iamVjdCwgJ3Byb3RvdHlwZScpOwogIGlmIChkZXNjLndyaXRhYmxlID09PSBmYWxzZSAmJgogICAgICBkZXNjLmVudW1lcmFibGUgPT09IGZhbHNlICYmCiAgICAgIGRlc2MuY29uZmlndXJhYmxlID09PSBmYWxzZSkgewogICAgcmV0dXJuIHRydWU7CiAgfQogfSwKCnByZWNvbmRpdGlvbjogZnVuY3Rpb24gcHJlcmVxKCkgewogIHJldHVybiBmbkV4aXN0cyhPYmplY3QuZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKTsKIH0KfSk7Cg=="}]}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"testsCollection":{"name":"Chapter - 15.2.4","numTests":"4","tests":[{"id":"15.2.4.2-1-1","code":"RVM1SGFybmVzcy5yZWdpc3RlclRlc3Qoew0KICAgIGlkOiAiMTUuMi40LjItMS0xIiwNCg0KICAgIHBhdGg6ICJUZXN0Q2FzZXMvY2hhcHRlcjE1LzE1LjIvMTUuMi40LzE1LjIuNC4yLzE1LjIuNC4yLTEtMS5qcyIsDQoNCiAgICBkZXNjcmlwdGlvbjogIk9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcgLSAnW29iamVjdCBVbmRlZmluZWRdJyB3aWxsIGJlIHJldHVybmVkIHdoZW4gJ3RoaXMnIHZhbHVlIGlzIHVuZGVmaW5lZCIsDQoNCiAgICB0ZXN0OiBmdW5jdGlvbiB0ZXN0Y2FzZSgpIHsNCiAgICAgICAgcmV0dXJuIE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbCh1bmRlZmluZWQpID09PSAiW29iamVjdCBVbmRlZmluZWRdIjsNCiAgICB9LA0KDQogICAgcHJlY29uZGl0aW9uOiBmdW5jdGlvbiBwcmVyZXEoKSB7DQogICAgICAgIHJldHVybiB0cnVlOw0KICAgIH0NCn0pOw0K"},{"id":"15.2.4.2-1-2","code":"RVM1SGFybmVzcy5yZWdpc3RlclRlc3Qoew0KICAgIGlkOiAiMTUuMi40LjItMS0yIiwNCg0KICAgIHBhdGg6ICJUZXN0Q2FzZXMvY2hhcHRlcjE1LzE1LjIvMTUuMi40LzE1LjIuNC4yLzE1LjIuNC4yLTEtMi5qcyIsDQoNCiAgICBkZXNjcmlwdGlvbjogIk9iamVjdC5wcm90b3R5cGUudG9TdHJ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0Q2FzZXMvY2hhcHRlcjE1LzE1LjIvMTUuMi40LzE1LjIuNC4yLzE1LjIuNC4yLTItMi5qcyIsDQoNCiAgICBkZXNjcmlwdGlvbjogIk9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcgLSAnW29iamVjdCBOdWxsXScgd2lsbCBiZSByZXR1cm5lZCB3aGVuICd0aGlzJyB2YWx1ZSBpcyBudWxsIiwNCg0KICAgIHRlc3Q6IGZ1bmN0aW9uIHRlc3RjYXNlKCkgew0KICAgICAgICByZXR1cm4gT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZy5hcHBseShudWxsLCBbXSkgPT09ICJbb2JqZWN0IE51bGxdIjsNCiAgICB9LA0KDQogICAgcHJlY29uZGl0aW9uOiBmdW5jdGlvbiBwcmVyZXEoKSB7DQogICAgICAgIHJldHVybiB0cnVlOw0KICAgIH0NCn0pOw0K"}]}}
{"testsCollection":{"name":"Chapter - 15.2.4","numTests":"4","tests":[{"id":"15.2.4.2-1-1","code":"RVM1SGFybmVzcy5yZWdpc3RlclRlc3QoewogICAgaWQ6ICIxNS4yLjQuMi0xLTEiLAoKICAgIHBhdGg6ICJUZXN0Q2FzZXMvY2hhcHRlcjE1LzE1LjIvMTUuMi40LzE1LjIuNC4yLzE1LjIuNC4yLTEtMS5qcyIsCgogICAgZGVzY3JpcHRpb246ICJPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nIC0gJ1tvYmplY3QgVW5kZWZpbmVkXScgd2lsbCBiZSByZXR1cm5lZCB3aGVuICd0aGlzJyB2YWx1ZSBpcyB1bmRlZmluZWQiLAoKICAgIHRlc3Q6IGZ1bmN0aW9uIHRlc3RjYXNlKCkgewogICAgICAgIHJldHVybiBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwodW5kZWZpbmVkKSA9PT0gIltvYmplY3QgVW5kZWZpbmVkXSI7CiAgICB9LAoKICAgIHByZWNvbmRpdGlvbjogZnVuY3Rpb24gcHJlcmVxKCkgewogICAgICAg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Y3QgTnVsbF0iOwogICAgfSwKCiAgICBwcmVjb25kaXRpb246IGZ1bmN0aW9uIHByZXJlcSgpIHsKICAgICAgICByZXR1cm4gdHJ1ZTsKICAgIH0KfSk7Cg=="},{"id":"15.2.4.2-2-2","code":"RVM1SGFybmVzcy5yZWdpc3RlclRlc3QoewogICAgaWQ6ICIxNS4yLjQuMi0yLTIiLAoKICAgIHBhdGg6ICJUZXN0Q2FzZXMvY2hhcHRlcjE1LzE1LjIvMTUuMi40LzE1LjIuNC4yLzE1LjIuNC4yLTItMi5qcyIsCgogICAgZGVzY3JpcHRpb246ICJPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nIC0gJ1tvYmplY3QgTnVsbF0nIHdpbGwgYmUgcmV0dXJuZWQgd2hlbiAndGhpcycgdmFsdWUgaXMgbnVsbCIsCgogICAgdGVzdDogZnVuY3Rpb24gdGVzdGNhc2UoKSB7CiAgICAgICAgcmV0dXJuIE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuYXBwbHkobnVsbCwgW10pID09PSAiW29iamVjdCBOdWxsXSI7CiAgICB9LAoKICAgIHByZWNvbmRpdGlvbjogZnVuY3Rpb24gcHJlcmVxKCkgewogICAgICAgIHJldHVybiB0cnVlOwogICAgfQp9KTsK"}]}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"testsCollection":{"name":"Chapter - 15.4.4.10","numTests":"1","tests":[{"id":"15.4.4.10-10-c-ii-1","code":"RVM1SGFybmVzcy5yZWdpc3RlclRlc3Qoew0KICAgIGlkOiAiMTUuNC40LjEwLTEwLWMtaWktMSIsDQoNCiAgICBwYXRoOiAiVGVzdENhc2VzL2NoYXB0ZXIxNS8xNS40LzE1LjQuNC8xNS40LjQuMTAvMTUuNC40LjEwLTEwLWMtaWktMS5qcyIsDQoNCiAgICBkZXNjcmlwdGlvbjogIkFycmF5LnByb3RvdHlwZS5zbGljZSB3aWxsIHNsaWNlIGEgc3RyaW5nIGZyb20gc3RhcnQgdG8gZW5kIHdoZW4gaW5kZXggcHJvcGVydHkgKHJlYWQtb25seSkgZXhpc3RzIGluIEFycmF5LnByb3RvdHlwZSAoU3RlcCAxMC5jLmlpKSIsDQoNCiAgICB0ZXN0OiBmdW5jdGlvbiB0ZXN0Y2FzZSgpIHsNCiAgICAgICAgdmFyIGFyck9iaiA9IFsxLCAyLCAzXTsNCiAgICAgICAgdHJ5IHsNCiAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShBcnJheS5wcm90b3R5cGUsICIwIiwgew0KICAgICAgICAgICAgICAgIHZhbHVlOiAidGVzdCIsDQogICAgICAgICAgICAgICAgd3JpdGFibGU6IGZhbHNlLA0KICAgICAgICAgICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZQ0KICAgICAgICAgICAgfSk7DQoNCiAgICAgICAgICAgIHZhciBuZXdBcnIgPSBhcnJPYmouc2xpY2UoMCwgMSk7DQogICAgICAgICAgICByZXR1cm4gbmV3QXJyLmhhc093blByb3BlcnR5KCIwIikgJiYgbmV3QXJyWzBdID09PSAxICYmIHR5cGVvZiBuZXdBcnJbMV0gPT09ICJ1bmRlZmluZWQiOw0KICAgICAgICB9IGZpbmFsbHkgew0KICAgICAgICAgICAgZGVsZXRlIEFycmF5LnByb3RvdHlwZVswXTsNCiAgICAgICAgfQ0KICAgIH0sDQoNCiAgICBwcmVjb25kaXRpb246IGZ1bmN0aW9uIHByZXJlcSgpIHsNCiAgICAgICAgcmV0dXJuIGZuRXhpc3RzKE9iamVjdC5kZWZpbmVQcm9wZXJ0eSk7DQogICAgfQ0KfSk7DQo="}]}}
{"testsCollection":{"name":"Chapter - 15.4.4.10","numTests":"1","tests":[{"id":"15.4.4.10-10-c-ii-1","code":"RVM1SGFybmVzcy5yZWdpc3RlclRlc3QoewogICAgaWQ6ICIxNS40LjQuMTAtMTAtYy1paS0xIiwKCiAgICBwYXRoOiAiVGVzdENhc2VzL2NoYXB0ZXIxNS8xNS40LzE1LjQuNC8xNS40LjQuMTAvMTUuNC40LjEwLTEwLWMtaWktMS5qcyIsCgogICAgZGVzY3JpcHRpb246ICJBcnJheS5wcm90b3R5cGUuc2xpY2Ugd2lsbCBzbGljZSBhIHN0cmluZyBmcm9tIHN0YXJ0IHRvIGVuZCB3aGVuIGluZGV4IHByb3BlcnR5IChyZWFkLW9ubHkpIGV4aXN0cyBpbiBBcnJheS5wcm90b3R5cGUgKFN0ZXAgMTAuYy5paSkiLAoKICAgIHRlc3Q6IGZ1bmN0aW9uIHRlc3RjYXNlKCkgewogICAgICAgIHZhciBhcnJPYmogPSBbMSwgMiwgM107CiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEFycmF5LnByb3RvdHlwZSwgIjAiLCB7CiAgICAgICAgICAgICAgICB2YWx1ZTogInRlc3QiLAogICAgICAgICAgICAgICAgd3JpdGFibGU6IGZhbHNlLAogICAgICAgICAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlCiAgICAgICAgICAgIH0pOwoKICAgICAgICAgICAgdmFyIG5ld0FyciA9IGFyck9iai5zbGljZSgwLCAxKTsKICAgICAgICAgICAgcmV0dXJuIG5ld0Fyci5oYXNPd25Qcm9wZXJ0eSgiMCIpICYmIG5ld0FyclswXSA9PT0gMSAmJiB0eXBlb2YgbmV3QXJyWzFdID09PSAidW5kZWZpbmVkIjsKICAgICAgICB9IGZpbmFsbHkgewogICAgICAgICAgICBkZWxldGUgQXJyYXkucHJvdG90eXBlWzBdOwogICAgICAgIH0KICAgIH0sCgogICAgcHJlY29uZGl0aW9uOiBmdW5jdGlvbiBwcmVyZXEoKSB7CiAgICAgICAgcmV0dXJuIGZuRXhpc3RzKE9iamVjdC5kZWZpbmVQcm9wZXJ0eSk7CiAgICB9Cn0pOwo="}]}}

View File

@ -1 +1 @@
{"testsCollection":{"name":"Chapter - 15.4.4.12","numTests":"2","tests":[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3MgdGhhbiAnYWN0dWFsRGVsZXRlQ291bnQgKFN0ZXAgOS5jLmlpKSIsDQoNCiAgICB0ZXN0OiBmdW5jdGlvbiB0ZXN0Y2FzZSgpIHsNCiAgICAgICAgdHJ5IHsNCiAgICAgICAgICAgIHZhciBhcnIgPSBbImEiLCAiYiIsICJjIl07DQogICAgICAgICAgICBBcnJheS5wcm90b3R5cGVbMF0gPSAidGVzdCI7DQogICAgICAgICAgICB2YXIgbmV3QXJyID0gYXJyLnNwbGljZSgyLCAxLCAiZCIpOw0KDQogICAgICAgICAgICB2YXIgdmVyaWZ5VmFsdWUgPSBmYWxzZTsNCiAgICAgICAgICAgIHZlcmlmeVZhbHVlID0gYXJyLmxlbmd0aCA9PT0gMyAmJiBhcnJbMF0gPT09ICJhIiAmJiBhcnJbMV0gPT09ICJiIiAmJiBhcnJbMl0gPT09ICJkIg0KICAgICAgICAgICAgICAgICYmIG5ld0FyclswXSA9PT0gImMiICYmIG5ld0Fyci5sZW5ndGggPT09IDE7DQoNCiAgICAgICAgICAgIHZhciB2ZXJpZnlFbnVtZXJhYmxlID0gZmFsc2U7DQogICAgICAgICAgICBmb3IgKHZhciBwIGluIG5ld0Fycikgew0KICAgICAgICAgICAgICAgIGlmIChuZXdBcnIuaGFzT3duUHJvcGVydHkoIjAiKSAmJiBwID09PSAiMCIpIHsNCiAgICAgICAgICAgICAgICAgICAgdmVyaWZ5RW51bWVyYWJsZSA9IHRydWU7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICB2YXIgdmVyaWZ5V3JpdGFibGUgPSBmYWxzZTsNCiAgICAgICAgICAgIG5ld0FyclswXSA9IDEyOw0KICAgICAgICAgICAgdmVyaWZ5V3JpdGFibGUgPSBuZXdBcnJbMF0gPT09IDEyOw0KDQogICAgICAgICAgICB2YXIgdmVyaWZ5Q29uZmlndXJhYmxlID0gZmFsc2U7DQogICAgICAgICAgICBkZWxldGUgbmV3QXJyWzBdOw0KICAgICAgICAgICAgdmVyaWZ5Q29uZmlndXJhYmxlID0gbmV3QXJyLmhhc093blByb3BlcnR5KCIwIik7DQoNCiAgICAgICAgICAgIHJldHVybiB2ZXJpZnlWYWx1ZSAmJiAhdmVyaWZ5Q29uZmlndXJhYmxlICYmIHZlcmlmeUVudW1lcmFibGUgJiYgdmVyaWZ5V3JpdGFibGU7DQogICAgICAgIH0gZmluYWxseSB7DQogICAgICAgICAgICBkZWxldGUgQXJyYXkucHJvdG90eXBlWzBdOw0KICAgICAgICB9DQogICAgfSwNCg0KICAgIHByZWNvbmRpdGlvbjogZnVuY3Rpb24gcHJlcmVxKCkgew0KICAgICAgICByZXR1cm4gZm5FeGlzdHMoT2JqZWN0LmRlZmluZVByb3BlcnR5KTsNCiAgICB9DQp9KTsNCg=="}]}}
{"testsCollection":{"name":"Chapter - 15.4.4.12","numTests":"2","tests":[{"id":"15.4.4.12-9-a-1","code":"RVM1SGFybmVzcy5yZWdpc3RlclRlc3QoewogICAgaWQ6ICIxNS40LjQuMTItOS1hLTEiLAoKICAgIHBhdGg6ICJUZXN0Q2FzZXMvY2hhcHRlcjE1LzE1LjQvMTUuNC40LzE1LjQuNC4xMi8xNS40LjQuMTItOS1hLTEuanMiLAoKICAgIGRlc2NyaXB0aW9uOiAiQXJyYXkucHJvdG90eXBlLnNwbGljZSAtICdmcm9tJyBpcyB0aGUgcmVzdWx0IG9mIFRvU3RyaW5nKGFjdHVhbFN0YXJ0K2spIGluIGFuIEFycmF5IiwKCiAgICB0ZXN0OiBmdW5jdGlvbiB0ZXN0Y2FzZSgpIHsKICAgICAgICB2YXIgYXJyT2JqID0gWzEsIDIsIDNdOwogICAgICAgIHZhciBuZXdBcnJPYmogPSBhcnJPYmouc3BsaWNlKC0yLCAxKTsKICAgICAgICByZXR1cm4gbmV3QXJyT2JqLmxlbmd0aCA9PT0gMSAmJiBuZXdBcnJPYmpbMF0gPT09IDI7CiAgICB9LAoKICAgIHByZWNvbmRpdGlvbjogZnVuY3Rpb24gcHJlcmVxKCkgewogICAgICAgIHJldHVybiB0cnVlOwogICAgfQp9KTsKCg=="},{"id":"15.4.4.12-9-c-ii-1","code":"RVM1SGFybmVzcy5yZWdpc3RlclRlc3QoewogICAgaWQ6ICIxNS40LjQuMTItOS1jLWlpLTEiLAoKICAgIHBhdGg6ICJUZXN0Q2FzZXMvY2hhcHRlcjE1LzE1LjQvMTUuNC40LzE1LjQuNC4xMi8xNS40LjQuMTItOS1jLWlpLTEuanMiLAoKICAgIGRlc2NyaXB0aW9uOiAiQXJyYXkucHJvdG90eXBlLnNwbGljZSB3aWxsIHNwbGljZSBhbiBhcnJheSBldmVuIHdoZW4gQXJyYXkucHJvdG90eXBlIGhhcyBpbmRleCAnMCcgc2V0IHRvIHJlYWQtb25seSBhbmQgJ2Zyb21QcmVzZW50JyBsZXNzIHRoYW4gJ2FjdHVhbERlbGV0ZUNvdW50IChTdGVwIDkuYy5paSkiLAoKICAgIHRlc3Q6IGZ1bmN0aW9uIHRlc3RjYXNlKCkgewogICAgICAgIHRyeSB7CiAgICAgICAgICAgIHZhciBhcnIgPSBbImEiLCAiYiIsICJjIl07CiAgICAgICAgICAgIEFycmF5LnByb3RvdHlwZVswXSA9ICJ0ZXN0IjsKICAgICAgICAgICAgdmFyIG5ld0FyciA9IGFyci5zcGxpY2UoMiwgMSwgImQiKTsKCiAgICAgICAgICAgIHZhciB2ZXJpZnlWYWx1ZSA9IGZhbHNlOwogICAgICAgICAgICB2ZXJpZnlWYWx1ZSA9IGFyci5sZW5ndGggPT09IDMgJiYgYXJyWzBdID09PSAiYSIgJiYgYXJyWzFdID09PSAiYiIgJiYgYXJyWzJdID09PSAiZCIKICAgICAgICAgICAgICAgICYmIG5ld0FyclswXSA9PT0gImMiICYmIG5ld0Fyci5sZW5ndGggPT09IDE7CgogICAgICAgICAgICB2YXIgdmVyaWZ5RW51bWVyYWJsZSA9IGZhbHNlOwogICAgICAgICAgICBmb3IgKHZhciBwIGluIG5ld0FycikgewogICAgICAgICAgICAgICAgaWYgKG5ld0Fyci5oYXNPd25Qcm9wZXJ0eSgiMCIpICYmIHAgPT09ICIwIikgewogICAgICAgICAgICAgICAgICAgIHZlcmlmeUVudW1lcmFibGUgPSB0cnVlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CgogICAgICAgICAgICB2YXIgdmVyaWZ5V3JpdGFibGUgPSBmYWxzZTsKICAgICAgICAgICAgbmV3QXJyWzBdID0gMTI7CiAgICAgICAgICAgIHZlcmlmeVdyaXRhYmxlID0gbmV3QXJyWzBdID09PSAxMjsKCiAgICAgICAgICAgIHZhciB2ZXJpZnlDb25maWd1cmFibGUgPSBmYWxzZTsKICAgICAgICAgICAgZGVsZXRlIG5ld0FyclswXTsKICAgICAgICAgICAgdmVyaWZ5Q29uZmlndXJhYmxlID0gbmV3QXJyLmhhc093blByb3BlcnR5KCIwIik7CgogICAgICAgICAgICByZXR1cm4gdmVyaWZ5VmFsdWUgJiYgIXZlcmlmeUNvbmZpZ3VyYWJsZSAmJiB2ZXJpZnlFbnVtZXJhYmxlICYmIHZlcmlmeVdyaXRhYmxlOwogICAgICAgIH0gZmluYWxseSB7CiAgICAgICAgICAgIGRlbGV0ZSBBcnJheS5wcm90b3R5cGVbMF07CiAgICAgICAgfQogICAgfSwKCiAgICBwcmVjb25kaXRpb246IGZ1bmN0aW9uIHByZXJlcSgpIHsKICAgICAgICByZXR1cm4gZm5FeGlzdHMoT2JqZWN0LmRlZmluZVByb3BlcnR5KTsKICAgIH0KfSk7Cg=="}]}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"testsCollection":{"name":"Chapter - 15.4.4.4","numTests":"2","tests":[{"id":"15.4.4.4-5-b-iii-3-b-1","code":"RVM1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KICAgICAgICAgICAgICAgICAgICB2ZXJpZnlFbnVtZXJhYmxlID0gdHJ1ZTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIHZhciB2ZXJpZnlXcml0YWJsZSA9IGZhbHNlOw0KICAgICAgICAgICAgbmV3QXJyWzBdID0gMTI7DQogICAgICAgICAgICB2ZXJpZnlXcml0YWJsZSA9IG5ld0FyclswXSA9PT0gMTI7DQoNCiAgICAgICAgICAgIHZhciB2ZXJpZnlDb25maWd1cmFibGUgPSBmYWxzZTsNCiAgICAgICAgICAgIGRlbGV0ZSBuZXdBcnJbMF07DQogICAgICAgICAgICB2ZXJpZnlDb25maWd1cmFibGUgPSBuZXdBcnIuaGFzT3duUHJvcGVydHkoIjAiKTsNCg0KICAgICAgICAgICAgcmV0dXJuIHZlcmlmeVZhbHVlICYmICF2ZXJpZnlDb25maWd1cmFibGUgJiYgdmVyaWZ5RW51bWVyYWJsZSAmJiB2ZXJpZnlXcml0YWJsZTsNCiAgICAgICAgfSBmaW5hbGx5IHsNCiAgICAgICAgICAgIGRlbGV0ZSBBcnJheS5wcm90b3R5cGVbMF07DQogICAgICAgIH0NCiAgICB9LA0KDQogICAgcHJlY29uZGl0aW9uOiBmdW5jdGlvbiBwcmVyZXEoKSB7DQogICAgICAgIHJldHVybiBmbkV4aXN0cyhPYmplY3QuZGVmaW5lUHJvcGVydHkpOw0KICAgIH0NCn0pOw0K"},{"id":"15.4.4.4-5-c-i-1","code":"RVM1SGFybmVzcy5yZWdpc3RlclRlc3Qoew0KICAgIGlkOiAiMTUuNC40LjQtNS1jLWktMSIsDQoNCiAgICBwYXRoOiAiVGVzdENhc2VzL2NoYXB0ZXIxNS8xNS40LzE1LjQuNC8xNS40LjQuNC8xNS40LjQuNC01LWMtaS0xLmpzIiwNCg0KICAgIGRlc2NyaXB0aW9uOiAiQXJyYXkucHJvdG90eXBlLmNvbmNhdCB3aWxsIGNvbmNhdCBhbiBBcnJheSB3aGVuIGluZGV4IHByb3BlcnR5IChyZWFkLW9ubHkpIGV4aXN0cyBpbiBBcnJheS5wcm90b3R5cGUgKFN0ZXAgNS5jLmkpIiwNCg0KICAgIHRlc3Q6IGZ1bmN0aW9uIHRlc3RjYXNlKCkgew0KICAgICAgICB0cnkgew0KICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEFycmF5LnByb3RvdHlwZSwgIjAiLCB7DQogICAgICAgICAgICAgICAgdmFsdWU6IDEwMCwNCiAgICAgICAgICAgICAgICB3cml0YWJsZTogZmFsc2UsDQogICAgICAgICAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlDQogICAgICAgICAgICB9KTsNCg0KICAgICAgICAgICAgdmFyIG5ld0FyciA9IEFycmF5LnByb3RvdHlwZS5jb25jYXQuY2FsbCgxMDEpOw0KDQogICAgICAgICAgICByZXR1cm4gbmV3QXJyLmhhc093blByb3BlcnR5KCIwIikgJiYgbmV3QXJyWzBdID09PSAxMDE7DQoNCiAgICAgICAgICAgIHZhciB2ZXJpZnlWYWx1ZSA9IGZhbHNlOw0KICAgICAgICAgICAgdmVyaWZ5VmFsdWUgPSBuZXdBcnJbMF0gPT09IDEwMTsNCg0KICAgICAgICAgICAgdmFyIHZlcmlmeUVudW1lcmFibGUgPSBmYWxzZTsNCiAgICAgICAgICAgIGZvciAodmFyIHAgaW4gbmV3QXJyKSB7DQogICAgICAgICAgICAgICAgaWYgKHAgPT09ICIwIiAmJiBuZXdBcnIuaGFzT3duUHJvcGVydHkoIjAiKSkgew0KICAgICAgICAgICAgICAgICAgICB2ZXJpZnlFbnVtZXJhYmxlID0gdHJ1ZTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQoNCiAgICAgICAgICAgIHZhciB2ZXJpZnlXcml0YWJsZSA9IGZhbHNlOw0KICAgICAgICAgICAgbmV3QXJyWzBdID0gMTI7DQogICAgICAgICAgICB2ZXJpZnlXcml0YWJsZSA9IG5ld0FyclswXSA9PT0gMTI7DQoNCiAgICAgICAgICAgIHZhciB2ZXJpZnlDb25maWd1cmFibGUgPSBmYWxzZTsNCiAgICAgICAgICAgIGRlbGV0ZSBuZXdBcnJbMF07DQogICAgICAgICAgICB2ZXJpZnlDb25maWd1cmFibGUgPSBuZXdBcnIuaGFzT3duUHJvcGVydHkoIjAiKTsNCg0KICAgICAgICAgICAgcmV0dXJuIHZlcmlmeVZhbHVlICYmICF2ZXJpZnlDb25maWd1cmFibGUgJiYgdmVyaWZ5RW51bWVyYWJsZSAmJiB2ZXJpZnlXcml0YWJsZTsNCg0KICAgICAgICB9IGZpbmFsbHkgew0KICAgICAgICAgICAgZGVsZXRlIEFycmF5LnByb3RvdHlwZVswXTsNCiAgICAgICAgfQ0KICAgIH0sDQoNCiAgICBwcmVjb25kaXRpb246IGZ1bmN0aW9uIHByZXJlcSgpIHsNCiAgICAgICAgcmV0dXJuIGZuRXhpc3RzKE9iamVjdC5kZWZpbmVQcm9wZXJ0eSk7DQogICAgfQ0KfSk7DQo="}]}}
{"testsCollection":{"name":"Chapter - 15.4.4.4","numTests":"2","tests":[{"id":"15.4.4.4-5-b-iii-3-b-1","code":"RVM1SGFybmVzcy5yZWdpc3RlclRlc3QoewogICAgaWQ6ICIxNS40LjQuNC01LWItaWlpLTMtYi0xIiwKCiAgICBwYXRoOiAiVGVzdENhc2VzL2NoYXB0ZXIxNS8xNS40LzE1LjQuNC8xNS40LjQuNC8xNS40LjQuNC01LWItaWlpLTMtYi0xLmpzIiwKCiAgICBkZXNjcmlwdGlvbjogIkFycmF5LnByb3RvdHlwZS5jb25jYXQgd2lsbCBjb25jYXQgYW4gQXJyYXkgd2hlbiBpbmRleCBwcm9wZXJ0eSAocmVhZC1vbmx5KSBleGlzdHMgaW4gQXJyYXkucHJvdG90eXBlIChTdGVwIDUuYi5paWkuMy5iKSIsCgogICAgdGVzdDogZnVuY3Rpb24gdGVzdGNhc2UoKSB7CiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEFycmF5LnByb3RvdHlwZSwgIjAiLCB7CiAgICAgICAgICAgICAgICB2YWx1ZTogMTAwLAogICAgICAgICAgICAgICAgd3JpdGFibGU6IGZhbHNlLAogICAgICAgICAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlCiAgICAgICAgICAgIH0pOwoKICAgICAgICAgICAgdmFyIG9sZEFyciA9IFsxMDFdOwoKICAgICAgICAgICAgdmFyIG5ld0FyciA9IEFycmF5LnByb3RvdHlwZS5jb25jYXQuY2FsbChvbGRBcnIpOwoKICAgICAgICAgICAgdmFyIHZlcmlmeVZhbHVlID0gZmFsc2U7CiAgICAgICAgICAgIHZlcmlmeVZhbHVlID0gbmV3QXJyWzBdID09PSAxMDE7CgogICAgICAgICAgICB2YXIgdmVyaWZ5RW51bWVyYWJsZSA9IGZhbHNlOwogICAgICAgICAgICBmb3IgKHZhciBwIGluIG5ld0FycikgewogICAgICAgICAgICAgICAgaWYgKHAgPT09ICIwIiAmJiBuZXdBcnIuaGFzT3duUHJvcGVydHkoIjAiKSkgewogICAgICAgICAgICAgICAgICAgIHZlcmlmeUVudW1lcmFibGUgPSB0cnVlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CgogICAgICAgICAgICB2YXIgdmVyaWZ5V3JpdGFibGUgPSBmYWxzZTsKICAgICAgICAgICAgbmV3QXJyWzBdID0gMTI7CiAgICAgICAgICAgIHZlcmlmeVdyaXRhYmxlID0gbmV3QXJyWzBdID09PSAxMjsKCiAgICAgICAgICAgIHZhciB2ZXJpZnlDb25maWd1cmFibGUgPSBmYWxzZTsKICAgICAgICAgICAgZGVsZXRlIG5ld0FyclswXTsKICAgICAgICAgICAgdmVyaWZ5Q29uZmlndXJhYmxlID0gbmV3QXJyLmhhc093blByb3BlcnR5KCIwIik7CgogICAgICAgICAgICByZXR1cm4gdmVyaWZ5VmFsdWUgJiYgIXZlcmlmeUNvbmZpZ3VyYWJsZSAmJiB2ZXJpZnlFbnVtZXJhYmxlICYmIHZlcmlmeVdyaXRhYmxlOwogICAgICAgIH0gZmluYWxseSB7CiAgICAgICAgICAgIGRlbGV0ZSBBcnJheS5wcm90b3R5cGVbMF07CiAgICAgICAgfQogICAgfSwKCiAgICBwcmVjb25kaXRpb246IGZ1bmN0aW9uIHByZXJlcSgpIHsKICAgICAgICByZXR1cm4gZm5FeGlzdHMoT2JqZWN0LmRlZmluZVByb3BlcnR5KTsKICAgIH0KfSk7Cg=="},{"id":"15.4.4.4-5-c-i-1","code":"RVM1SGFybmVzcy5yZWdpc3RlclRlc3QoewogICAgaWQ6ICIxNS40LjQuNC01LWMtaS0xIiwKCiAgICBwYXRoOiAiVGVzdENhc2VzL2NoYXB0ZXIxNS8xNS40LzE1LjQuNC8xNS40LjQuNC8xNS40LjQuNC01LWMtaS0xLmpzIiwKCiAgICBkZXNjcmlwdGlvbjogIkFycmF5LnByb3RvdHlwZS5jb25jYXQgd2lsbCBjb25jYXQgYW4gQXJyYXkgd2hlbiBpbmRleCBwcm9wZXJ0eSAocmVhZC1vbmx5KSBleGlzdHMgaW4gQXJyYXkucHJvdG90eXBlIChTdGVwIDUuYy5pKSIsCgogICAgdGVzdDogZnVuY3Rpb24gdGVzdGNhc2UoKSB7CiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEFycmF5LnByb3RvdHlwZSwgIjAiLCB7CiAgICAgICAgICAgICAgICB2YWx1ZTogMTAwLAogICAgICAgICAgICAgICAgd3JpdGFibGU6IGZhbHNlLAogICAgICAgICAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlCiAgICAgICAgICAgIH0pOwoKICAgICAgICAgICAgdmFyIG5ld0FyciA9IEFycmF5LnByb3RvdHlwZS5jb25jYXQuY2FsbCgxMDEpOwoKICAgICAgICAgICAgcmV0dXJuIG5ld0Fyci5oYXNPd25Qcm9wZXJ0eSgiMCIpICYmIG5ld0FyclswXSA9PT0gMTAxOwoKICAgICAgICAgICAgdmFyIHZlcmlmeVZhbHVlID0gZmFsc2U7CiAgICAgICAgICAgIHZlcmlmeVZhbHVlID0gbmV3QXJyWzBdID09PSAxMDE7CgogICAgICAgICAgICB2YXIgdmVyaWZ5RW51bWVyYWJsZSA9IGZhbHNlOwogICAgICAgICAgICBmb3IgKHZhciBwIGluIG5ld0FycikgewogICAgICAgICAgICAgICAgaWYgKHAgPT09ICIwIiAmJiBuZXdBcnIuaGFzT3duUHJvcGVydHkoIjAiKSkgewogICAgICAgICAgICAgICAgICAgIHZlcmlmeUVudW1lcmFibGUgPSB0cnVlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CgogICAgICAgICAgICB2YXIgdmVyaWZ5V3JpdGFibGUgPSBmYWxzZTsKICAgICAgICAgICAgbmV3QXJyWzBdID0gMTI7CiAgICAgICAgICAgIHZlcmlmeVdyaXRhYmxlID0gbmV3QXJyWzBdID09PSAxMjsKCiAgICAgICAgICAgIHZhciB2ZXJpZnlDb25maWd1cmFibGUgPSBmYWxzZTsKICAgICAgICAgICAgZGVsZXRlIG5ld0FyclswXTsKICAgICAgICAgICAgdmVyaWZ5Q29uZmlndXJhYmxlID0gbmV3QXJyLmhhc093blByb3BlcnR5KCIwIik7CgogICAgICAgICAgICByZXR1cm4gdmVyaWZ5VmFsdWUgJiYgIXZlcmlmeUNvbmZpZ3VyYWJsZSAmJiB2ZXJpZnlFbnVtZXJhYmxlICYmIHZlcmlmeVdyaXRhYmxlOwoKICAgICAgICB9IGZpbmFsbHkgewogICAgICAgICAgICBkZWxldGUgQXJyYXkucHJvdG90eXBlWzBdOwogICAgICAgIH0KICAgIH0sCgogICAgcHJlY29uZGl0aW9uOiBmdW5jdGlvbiBwcmVyZXEoKSB7CiAgICAgICAgcmV0dXJuIGZuRXhpc3RzKE9iamVjdC5kZWZpbmVQcm9wZXJ0eSk7CiAgICB9Cn0pOwo="}]}}

View File

@ -1 +1 @@
{"testsCollection":{"name":"Chapter - 15.4.5","numTests":"6","tests":[{"id":"15.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4.5.1-5-2","code":"RVM1SGFybmVzcy5yZWdpc3RlclRlc3QoIHsKaWQ6ICIxNS40LjUuMS01LTIiLAoKcGF0aDogIlRlc3RDYXNlcy9jaGFwdGVyMTUvMTUuNC8xNS40LjUvMTUuNC41LjEvMTUuNC41LjEtNS0yLmpzIiwKCmRlc2NyaXB0aW9uOiAiRGVmaW5pbmcgYSBwcm9wZXJ0eSBuYW1lZCA0Mjk0OTY3Mjk1ICgyKiozMi0xKSBkb2Vzbid0IGNoYW5nZSBsZW5ndGggb2YgdGhlIGFycmF5IiwKCnRlc3Q6IGZ1bmN0aW9uIHRlc3RjYXNlKCkgeyAgCiAgdmFyIGEgPVswLDEsMl07CiAgYVs0Mjk0OTY3Mjk1XSA9ICJub3QgYW4gYXJyYXkgZWxlbWVudCIgOwogIHJldHVybiBhLmxlbmd0aD09PTM7CiB9Cn0pOwo="}]}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"testsCollection":{"name":"Chapter - 15.7","numTests":"5","tests":[{"id":"15.7.3.1-1","code":"RVM1SGFybmVzcy5yZWdpc3RlclRlc3QoIHsNCmlkOiAiMTUuNy4zLjEtMSIsDQoNCnBhdGg6ICJUZXN0Q2FzZXMvY2hhcHRlcjE1LzE1LjcvMTUuNy4zLzE1LjcuMy4xLzE1LjcuMy4xLTEuanMiLA0KDQpkZXNjcmlwdGlvbjogIk51bWJlci5wcm90b3R5cGUgaXMgYSBkYXRhIHByb3BlcnR5IHdpdGggZGVmYXVsdCBhdHRyaWJ1dGUgdmFsdWVzIChmYWxzZSkiLA0KDQp0ZXN0OiBmdW5jdGlvbiB0ZXN0Y2FzZSgpIHsNCiAgdmFyIGQgPSBPYmplY3QuZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKE51bWJlciwgJ3Byb3RvdHlwZScpOw0KICANCiAgaWYgKGQud3JpdGFibGUgPT09IGZhbHNlICYmD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c11dIG11c3QgYmUgJ051bWJlciciLA0KDQp0ZXN0OiBmdW5jdGlvbiB0ZXN0Y2FzZSgpIHsNCiAgdmFyIG51bVByb3RvID0gT2JqZWN0LmdldFByb3RvdHlwZU9mKG5ldyBOdW1iZXIoNDIpKTsNCiAgdmFyIHMgPSBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwobnVtUHJvdG8gKTsNCiAgcmV0dXJuIChzID09PSAnW29iamVjdCBOdW1iZXJdJykgOw0KIH0sDQoNCnByZWNvbmRpdGlvbjogZnVuY3Rpb24gcHJlcmVxKCkgew0KICByZXR1cm4gZm5FeGlzdHMoT2JqZWN0LmdldFByb3RvdHlwZU9mKTsNCiB9DQoNCn0pOw0K"}]}}
{"testsCollection":{"name":"Chapter - 15.7","numTests":"5","tests":[{"id":"15.7.3-1","code":"RVM1SGFybmVzcy5yZWdpc3RlclRlc3QoIHsKaWQ6ICIxNS43LjMtMSIsCgpwYXRoOiAiVGVzdENhc2VzL2NoYXB0ZXIxNS8xNS43LzE1LjcuMy8xNS43LjMtMS5qcyIsCgpkZXNjcmlwdGlvbjogIk51bWJlciBjb25zdHJ1Y3RvciAtIFtbUHJvdG90eXBlXV0gaXMgdGhlIEZ1bmN0aW9uIHByb3RvdHlwZSBvYmplY3QiLAoKdGVzdDogZnVuY3Rpb24gdGVzdGNhc2UoKSB7CiAgaWYgKEZ1bmN0aW9uLnByb3RvdHlwZS5pc1Byb3RvdHlwZU9mKE51bWJlcikgPT09IHRydWUpIHsKICAgIHJldHVybiB0cnVlOwogIH0KIH0KfSk7Cg=="},{"id":"15.7.3-2","code":"RVM1SGFybmVzcy5yZWdpc3RlclRlc3QoIHsKaWQ6ICIxNS43LjMtMiIsCgpwYXRoOiAiVGVzdENhc2VzL2NoYXB0ZXIxNS8xNS43LzE1LjcuMy8xNS43LjMtMi5qcyIsCgpkZXNjcmlwdGlvbjogIk51bWJlciBjb25zdHJ1Y3RvciAtIFtbUHJvdG90eXBlXV0gaXMg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HJlY29uZGl0aW9uOiBmdW5jdGlvbiBwcmVyZXEoKSB7CiAgcmV0dXJuIGZuRXhpc3RzKE9iamVjdC5nZXRQcm90b3R5cGVPZik7CiB9Cgp9KTsK"}]}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"numTests":10456,"version":"0.6","date":"03/11/2011","testSuite":["resources/scripts/testcases/07_Lexical_Conventions.json","resources/scripts/testcases/08_Types.json","resources/scripts/testcases/09_Type_Conversion.json","resources/scripts/testcases/10_Execution_Contexts.json","resources/scripts/testcases/11.10_Binary_Bitwise_Operators.json","resources/scripts/testcases/11.11_Binary_Logical_Operators.json","resources/scripts/testcases/11.12_Conditional_Operator.json","resources/scripts/testcases/11.13_Assignment_Operators.json","resources/scripts/testcases/11.14_Comma_Operator.json","resources/scripts/testcases/11.1_Primary_Expressions.json","resources/scripts/testcases/11.2_Left_Hand_Side_Expressions.json","resources/scripts/testcases/11.3_PostfixExpressions.json","resources/scripts/testcases/11.4_Unary_Operators.json","resources/scripts/testcases/11.5_Multiplicative_Operators.json","resources/scripts/testcases/11.6_Additive_Operators.json","resources/scripts/testcases/11.7_Bitwise_Shift_Operators.json","resources/scripts/testcases/11.8_Relational_Operators.json","resources/scripts/testcases/11.9_Equality_Operators.json","resources/scripts/testcases/12_Statement.json","resources/scripts/testcases/13_Function_Definition.json","resources/scripts/testcases/14_Program.json","resources/scripts/testcases/15.10_RegExp_Objects.json","resources/scripts/testcases/15.11_Error_Objects.json","resources/scripts/testcases/15.1_The_Global_Object.json","resources/scripts/testcases/15.2_Object_Objects.json","resources/scripts/testcases/15.3_Function_Objects.json","resources/scripts/testcases/15.4_Array_Objects.json","resources/scripts/testcases/15.5_String_Objects.json","resources/scripts/testcases/15.6_Boolean_Objects.json","resources/scripts/testcases/15.7_Number_Objects.json","resources/scripts/testcases/15.8_The_Math_Object.json","resources/scripts/testcases/15.9_Date_Objects.json","resources/scripts/testcases/chapter07.json","resources/scripts/testcases/chapter10.json","resources/scripts/testcases/chapter11.json","resources/scripts/testcases/chapter12.json","resources/scripts/testcases/chapter13.json","resources/scripts/testcases/15.1.json","resources/scripts/testcases/15.10.json","resources/scripts/testcases/15.11.json","resources/scripts/testcases/15.12.json","resources/scripts/testcases/15.2.3.1.json","resources/scripts/testcases/15.2.3.10.json","resources/scripts/testcases/15.2.3.11.json","resources/scripts/testcases/15.2.3.12.json","resources/scripts/testcases/15.2.3.13.json","resources/scripts/testcases/15.2.3.14.json","resources/scripts/testcases/15.2.3.2.json","resources/scripts/testcases/15.2.3.3.json","resources/scripts/testcases/15.2.3.4.json","resources/scripts/testcases/15.2.3.5.json","resources/scripts/testcases/15.2.3.6.json","resources/scripts/testcases/15.2.3.7.json","resources/scripts/testcases/15.2.3.8.json","resources/scripts/testcases/15.2.3.9.json","resources/scripts/testcases/15.2.4.json","resources/scripts/testcases/15.3.json","resources/scripts/testcases/15.4.3.json","resources/scripts/testcases/15.4.4.10.json","resources/scripts/testcases/15.4.4.12.json","resources/scripts/testcases/15.4.4.14.json","resources/scripts/testcases/15.4.4.15.json","resources/scripts/testcases/15.4.4.16.json","resources/scripts/testcases/15.4.4.17.json","resources/scripts/testcases/15.4.4.18.json","resources/scripts/testcases/15.4.4.19.json","resources/scripts/testcases/15.4.4.20.json","resources/scripts/testcases/15.4.4.21.json","resources/scripts/testcases/15.4.4.22.json","resources/scripts/testcases/15.4.4.4.json","resources/scripts/testcases/15.4.5.json","resources/scripts/testcases/15.5.json","resources/scripts/testcases/15.7.json","resources/scripts/testcases/15.9.json"]}
{"numTests":10456,"version":"0.6.2","date":"2011-03-23","testSuite":["resources/scripts/testcases/07_Lexical_Conventions.json","resources/scripts/testcases/08_Types.json","resources/scripts/testcases/09_Type_Conversion.json","resources/scripts/testcases/10_Execution_Contexts.json","resources/scripts/testcases/11.10_Binary_Bitwise_Operators.json","resources/scripts/testcases/11.11_Binary_Logical_Operators.json","resources/scripts/testcases/11.12_Conditional_Operator.json","resources/scripts/testcases/11.13_Assignment_Operators.json","resources/scripts/testcases/11.14_Comma_Operator.json","resources/scripts/testcases/11.1_Primary_Expressions.json","resources/scripts/testcases/11.2_Left_Hand_Side_Expressions.json","resources/scripts/testcases/11.3_PostfixExpressions.json","resources/scripts/testcases/11.4_Unary_Operators.json","resources/scripts/testcases/11.5_Multiplicative_Operators.json","resources/scripts/testcases/11.6_Additive_Operators.json","resources/scripts/testcases/11.7_Bitwise_Shift_Operators.json","resources/scripts/testcases/11.8_Relational_Operators.json","resources/scripts/testcases/11.9_Equality_Operators.json","resources/scripts/testcases/12_Statement.json","resources/scripts/testcases/13_Function_Definition.json","resources/scripts/testcases/14_Program.json","resources/scripts/testcases/15.10_RegExp_Objects.json","resources/scripts/testcases/15.11_Error_Objects.json","resources/scripts/testcases/15.1_The_Global_Object.json","resources/scripts/testcases/15.2_Object_Objects.json","resources/scripts/testcases/15.3_Function_Objects.json","resources/scripts/testcases/15.4_Array_Objects.json","resources/scripts/testcases/15.5_String_Objects.json","resources/scripts/testcases/15.6_Boolean_Objects.json","resources/scripts/testcases/15.7_Number_Objects.json","resources/scripts/testcases/15.8_The_Math_Object.json","resources/scripts/testcases/15.9_Date_Objects.json","resources/scripts/testcases/chapter07.json","resources/scripts/testcases/chapter10.json","resources/scripts/testcases/chapter11.json","resources/scripts/testcases/chapter12.json","resources/scripts/testcases/chapter13.json","resources/scripts/testcases/15.1.json","resources/scripts/testcases/15.10.json","resources/scripts/testcases/15.11.json","resources/scripts/testcases/15.12.json","resources/scripts/testcases/15.2.3.1.json","resources/scripts/testcases/15.2.3.10.json","resources/scripts/testcases/15.2.3.11.json","resources/scripts/testcases/15.2.3.12.json","resources/scripts/testcases/15.2.3.13.json","resources/scripts/testcases/15.2.3.14.json","resources/scripts/testcases/15.2.3.2.json","resources/scripts/testcases/15.2.3.3.json","resources/scripts/testcases/15.2.3.4.json","resources/scripts/testcases/15.2.3.5.json","resources/scripts/testcases/15.2.3.6.json","resources/scripts/testcases/15.2.3.7.json","resources/scripts/testcases/15.2.3.8.json","resources/scripts/testcases/15.2.3.9.json","resources/scripts/testcases/15.2.4.json","resources/scripts/testcases/15.3.json","resources/scripts/testcases/15.4.3.json","resources/scripts/testcases/15.4.4.10.json","resources/scripts/testcases/15.4.4.12.json","resources/scripts/testcases/15.4.4.14.json","resources/scripts/testcases/15.4.4.15.json","resources/scripts/testcases/15.4.4.16.json","resources/scripts/testcases/15.4.4.17.json","resources/scripts/testcases/15.4.4.18.json","resources/scripts/testcases/15.4.4.19.json","resources/scripts/testcases/15.4.4.20.json","resources/scripts/testcases/15.4.4.21.json","resources/scripts/testcases/15.4.4.22.json","resources/scripts/testcases/15.4.4.4.json","resources/scripts/testcases/15.4.5.json","resources/scripts/testcases/15.5.json","resources/scripts/testcases/15.7.json","resources/scripts/testcases/15.9.json"]}