@@ -1868,12 +1868,181 @@ Serializer.Mutations.testSuites = [
18681868 Serializer . Mutations . Procedure ,
18691869] ;
18701870
1871+ Serializer . Comments = new SerializerTestSuite ( 'Comments' ) ;
1872+
1873+ Serializer . Comments . Coordinates = new SerializerTestSuite ( 'Coordinates' ) ;
1874+ Serializer . Comments . Coordinates . Basic = new SerializerTestCase (
1875+ 'Basic' ,
1876+ '<xml xmlns="https://developers.google.com/blockly/xml">' +
1877+ '<comment id="id******************" x="42" y="42" w="42" h="42">' +
1878+ '</comment>' +
1879+ '</xml>' ,
1880+ ) ;
1881+ Serializer . Comments . Coordinates . Negative = new SerializerTestCase (
1882+ 'Negative' ,
1883+ '<xml xmlns="https://developers.google.com/blockly/xml">' +
1884+ '<comment id="id******************" x="-42" y="-42" w="42" h="42">' +
1885+ '</comment>' +
1886+ '</xml>' ,
1887+ ) ;
1888+ Serializer . Comments . Coordinates . Zero = new SerializerTestCase (
1889+ 'Zero' ,
1890+ '<xml xmlns="https://developers.google.com/blockly/xml">' +
1891+ '<comment id="id******************" x="0" y="0" w="42" h="42">' +
1892+ '</comment>' +
1893+ '</xml>' ,
1894+ ) ;
1895+ Serializer . Comments . Coordinates . testCases = [
1896+ Serializer . Comments . Coordinates . Basic ,
1897+ Serializer . Comments . Coordinates . Negative ,
1898+ Serializer . Comments . Coordinates . Zero ,
1899+ ] ;
1900+
1901+ Serializer . Comments . Size = new SerializerTestSuite ( 'Size' ) ;
1902+ Serializer . Comments . Size . Basic = new SerializerTestCase (
1903+ 'Basic' ,
1904+ '<xml xmlns="https://developers.google.com/blockly/xml">' +
1905+ '<comment id="id******************" x="42" y="42" w="42" h="42">' +
1906+ '</comment>' +
1907+ '</xml>' ,
1908+ ) ;
1909+ Serializer . Comments . Size . testCases = [ Serializer . Comments . Size . Basic ] ;
1910+
1911+ Serializer . Comments . Text = new SerializerTestSuite ( 'Text' ) ;
1912+ Serializer . Comments . Text . Symbols = new SerializerTestCase (
1913+ 'Symbols' ,
1914+ '<xml xmlns="https://developers.google.com/blockly/xml">' +
1915+ '<comment id="id******************" x="42" y="42" w="42" h="42">' +
1916+ '~`!@#$%^*()_+-={[}]|\\:;,.?/' +
1917+ '</comment>' +
1918+ '</xml>' ,
1919+ ) ;
1920+ Serializer . Comments . Text . EscapedSymbols = new SerializerTestCase (
1921+ 'EscapedSymbols' ,
1922+ '<xml xmlns="https://developers.google.com/blockly/xml">' +
1923+ '<comment id="id******************" x="42" y="42" w="42" h="42">' +
1924+ '&<>' +
1925+ '</comment>' +
1926+ '</xml>' ,
1927+ ) ;
1928+ Serializer . Comments . Text . SingleQuotes = new SerializerTestCase (
1929+ 'SingleQuotes' ,
1930+ '<xml xmlns="https://developers.google.com/blockly/xml">' +
1931+ '<comment id="id******************" x="42" y="42" w="42" h="42">' +
1932+ "'test'" +
1933+ '</comment>' +
1934+ '</xml>' ,
1935+ ) ;
1936+ Serializer . Comments . Text . DoubleQuotes = new SerializerTestCase (
1937+ 'DoubleQuotes' ,
1938+ '<xml xmlns="https://developers.google.com/blockly/xml">' +
1939+ '<comment id="id******************" x="42" y="42" w="42" h="42">' +
1940+ '"test"' +
1941+ '</comment>' +
1942+ '</xml>' ,
1943+ ) ;
1944+ Serializer . Comments . Text . Numbers = new SerializerTestCase (
1945+ 'Numbers' ,
1946+ '<xml xmlns="https://developers.google.com/blockly/xml">' +
1947+ '<comment id="id******************" x="42" y="42" w="42" h="42">' +
1948+ '1234567890a123a123a' +
1949+ '</comment>' +
1950+ '</xml>' ,
1951+ ) ;
1952+ Serializer . Comments . Text . Emoji = new SerializerTestCase (
1953+ 'Emoji' ,
1954+ '<xml xmlns="https://developers.google.com/blockly/xml">' +
1955+ '<comment id="id******************" x="42" y="42" w="42" h="42">' +
1956+ '😀👋🏿👋🏾👋🏽👋🏼👋🏻😀❤❤❤' +
1957+ '</comment>' +
1958+ '</xml>' ,
1959+ ) ;
1960+ Serializer . Comments . Text . Russian = new SerializerTestCase (
1961+ 'Russian' ,
1962+ '<xml xmlns="https://developers.google.com/blockly/xml">' +
1963+ '<comment id="id******************" x="42" y="42" w="42" h="42">' +
1964+ 'ты любопытный кот' +
1965+ '</comment>' +
1966+ '</xml>' ,
1967+ ) ;
1968+ Serializer . Comments . Text . Japanese = new SerializerTestCase (
1969+ 'Japanese' ,
1970+ '<xml xmlns="https://developers.google.com/blockly/xml">' +
1971+ '<comment id="id******************" x="42" y="42" w="42" h="42">' +
1972+ 'あなたは好奇心旺盛な猫です' +
1973+ '</comment>' +
1974+ '</xml>' ,
1975+ ) ;
1976+ Serializer . Comments . Text . Zalgo = new SerializerTestCase (
1977+ 'Zalgo' ,
1978+ '<xml xmlns="https://developers.google.com/blockly/xml">' +
1979+ '<comment id="id******************" x="42" y="42" w="42" h="42">' +
1980+ 'z̴̪͈̲̜͕̽̈̀͒͂̓̋̉̍a̸̧̧̜̻̘̤̫̱̲͎̞̻͆̋ļ̸̛̖̜̳͚̖͔̟̈́͂̉̀͑̑͑̎ǵ̸̫̳̽̐̃̑̚̕o̶͇̫͔̮̼̭͕̹̘̬͋̀͆̂̇̋͊̒̽' +
1981+ '</comment>' +
1982+ '</xml>' ,
1983+ ) ;
1984+ Serializer . Comments . Text . testCases = [
1985+ Serializer . Comments . Text . Symbols ,
1986+ Serializer . Comments . Text . EscapedSymbols ,
1987+ Serializer . Comments . Text . SingleQuotes ,
1988+ Serializer . Comments . Text . DoubleQuotes ,
1989+ Serializer . Comments . Text . Numbers ,
1990+ Serializer . Comments . Text . Emoji ,
1991+ Serializer . Comments . Text . Russian ,
1992+ Serializer . Comments . Text . Japanese ,
1993+ Serializer . Comments . Text . Zalgo ,
1994+ ] ;
1995+
1996+ Serializer . Comments . Attributes = new SerializerTestSuite ( 'Attributes' ) ;
1997+ Serializer . Comments . Attributes . Collapsed = new SerializerTestCase (
1998+ 'Collapsed' ,
1999+ '<xml xmlns="https://developers.google.com/blockly/xml">' +
2000+ '<comment id="id******************" x="42" y="42" w="42" h="42" collapsed="true">' +
2001+ '</comment>' +
2002+ '</xml>' ,
2003+ ) ;
2004+ Serializer . Comments . Attributes . NotEditable = new SerializerTestCase (
2005+ 'NotEditable' ,
2006+ '<xml xmlns="https://developers.google.com/blockly/xml">' +
2007+ '<comment id="id******************" x="42" y="42" w="42" h="42" editable="false">' +
2008+ '</comment>' +
2009+ '</xml>' ,
2010+ ) ;
2011+ Serializer . Comments . Attributes . NotMovable = new SerializerTestCase (
2012+ 'NotMovable' ,
2013+ '<xml xmlns="https://developers.google.com/blockly/xml">' +
2014+ '<comment id="id******************" x="42" y="42" w="42" h="42" movable="false">' +
2015+ '</comment>' +
2016+ '</xml>' ,
2017+ ) ;
2018+ Serializer . Comments . Attributes . NotDeletable = new SerializerTestCase (
2019+ 'NotDeletable' ,
2020+ '<xml xmlns="https://developers.google.com/blockly/xml">' +
2021+ '<comment id="id******************" x="42" y="42" w="42" h="42" deletable="false">' +
2022+ '</comment>' +
2023+ '</xml>' ,
2024+ ) ;
2025+ Serializer . Comments . Attributes . testCases = [
2026+ Serializer . Comments . Attributes . Collapsed ,
2027+ Serializer . Comments . Attributes . NotEditable ,
2028+ Serializer . Comments . Attributes . NotMovable ,
2029+ Serializer . Comments . Attributes . NotDeletable ,
2030+ ] ;
2031+
2032+ Serializer . Comments . testSuites = [
2033+ Serializer . Comments . Coordinates ,
2034+ Serializer . Comments . Size ,
2035+ Serializer . Comments . Text ,
2036+ Serializer . Comments . Attributes ,
2037+ ] ;
2038+
18712039Serializer . testSuites = [
18722040 Serializer . Attributes ,
18732041 Serializer . Fields ,
18742042 Serializer . Icons ,
18752043 Serializer . Connections ,
18762044 Serializer . Mutations ,
2045+ Serializer . Comments ,
18772046] ;
18782047
18792048const runSerializerTestSuite = ( serializer , deserializer , testSuite ) => {
0 commit comments