1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 02:44:36 +03:00

Correct the JSON diff fixtures.

This commit is contained in:
Rob Rix 2017-04-28 09:50:21 -04:00
parent 71371f6a96
commit cb040449bf

View File

@ -76,8 +76,8 @@ instance Listable DiffFixture where
splitOutput' = "<!DOCTYPE HTML>\n<html><head><link rel=\"stylesheet\" href=\"style.css\"></head><body><table class=\"diff\"><colgroup><col width=\"40\"><col><col width=\"40\"><col></colgroup><tr><td class=\"blob-num blob-num-empty empty-cell\"></td><td class=\"blob-code blob-code-empty empty-cell\"></td>\n<td class=\"blob-num blob-num-replacement\">1</td><td class=\"blob-code blob-code-replacement\"><div class=\"patch insert\"><ul class=\"category-program\"><li><ul class=\"category-method\">def <li><span class=\"category-identifier\">foo</span></li>\n</ul></li></ul></div></td>\n\n</tr><tr><td class=\"blob-num blob-num-empty empty-cell\"></td><td class=\"blob-code blob-code-empty empty-cell\"></td>\n<td class=\"blob-num blob-num-replacement\">2</td><td class=\"blob-code blob-code-replacement\"><div class=\"patch insert\"><ul class=\"category-program\"><li><ul class=\"category-method\">end</ul></li>\n</ul></div></td>\n\n</tr><tr><td class=\"blob-num blob-num-empty empty-cell\"></td><td class=\"blob-code blob-code-empty empty-cell\"></td>\n<td class=\"blob-num blob-num-replacement\">3</td><td class=\"blob-code blob-code-replacement\"><div class=\"patch insert\"><ul class=\"category-program\"></ul></div></td>\n\n</tr></table></body></html>\n"
summaryOutput = "{\"changes\":{\"test/fixtures/ruby/method-declaration.A.rb -> test/fixtures/ruby/method-declaration.B.rb\":[{\"span\":{\"replace\":[{\"start\":[1,5],\"end\":[1,8]},{\"start\":[1,5],\"end\":[1,8]}]},\"summary\":\"Replaced the 'foo' identifier with the 'bar' identifier in the 'bar(\226\128\166)' method\"},{\"span\":{\"insert\":{\"start\":[1,9],\"end\":[1,10]}},\"summary\":\"Added the 'a' identifier in the 'bar(\226\128\166)' method\"},{\"span\":{\"insert\":{\"start\":[2,3],\"end\":[2,6]}},\"summary\":\"Added the 'baz' identifier in the 'bar(\226\128\166)' method\"}]},\"errors\":{}}\n"
summaryOutput' = "{\"changes\":{\"methods.rb\":[{\"span\":{\"insert\":{\"start\":[1,1],\"end\":[2,4]}},\"summary\":\"Added the 'foo()' method\"}]},\"errors\":{}}\n"
jsonOutput = "{\"oids\":[\"0000000000000000000000000000000000000000\",\"0000000000000000000000000000000000000000\"],\"paths\":[\"test/fixtures/ruby/method-declaration.A.rb\",\"test/fixtures/ruby/method-declaration.B.rb\"],\"rows\":[[{\"terms\":[{\"category\":\"Program\",\"children\":[{\"category\":\"Method\",\"children\":[{\"category\":\"Identifier\",\"patch\":\"replace\",\"range\":[4,7]}],\"range\":[0,8]}],\"range\":[0,8]}],\"hasChanges\":true,\"range\":[0,8],\"number\":1},{\"terms\":[{\"category\":\"Program\",\"children\":[{\"category\":\"Method\",\"children\":[{\"category\":\"Identifier\",\"patch\":\"replace\",\"range\":[4,7]},{\"category\":\"Params\",\"children\":[{\"category\":\"Identifier\",\"range\":[8,9]}],\"patch\":\"insert\",\"range\":[7,11]}],\"range\":[0,11]}],\"range\":[0,11]}],\"hasChanges\":true,\"range\":[0,11],\"number\":1}],[{\"terms\":[{\"category\":\"Program\",\"children\":[{\"category\":\"Method\",\"children\":[{\"category\":\"Params\",\"children\":[],\"patch\":\"insert\",\"range\":[11,13]},{\"category\":\"Identifier\",\"patch\":\"insert\",\"range\":[13,16]}],\"range\":[11,17]}],\"range\":[11,17]}],\"hasChanges\":true,\"range\":[11,17],\"number\":2}],[{\"terms\":[{\"category\":\"Program\",\"children\":[{\"category\":\"Method\",\"children\":[],\"range\":[8,11]}],\"range\":[8,12]}],\"hasChanges\":false,\"range\":[8,12],\"number\":2},{\"terms\":[{\"category\":\"Program\",\"children\":[{\"category\":\"Method\",\"children\":[],\"range\":[17,20]}],\"range\":[17,21]}],\"hasChanges\":false,\"range\":[17,21],\"number\":3}],[{\"terms\":[{\"category\":\"Program\",\"children\":[],\"range\":[12,12]}],\"hasChanges\":false,\"range\":[12,12],\"number\":3},{\"terms\":[{\"category\":\"Program\",\"children\":[],\"range\":[21,21]}],\"hasChanges\":false,\"range\":[21,21],\"number\":4}]]}\n"
jsonOutput' = "{\"oids\":[\"0000000000000000000000000000000000000000\",\"ff7bbbe9495f61d9e1e58c597502d152bab1761e\"],\"paths\":[\"methods.rb\",\"methods.rb\"],\"rows\":[[{\"terms\":[{\"category\":\"Program\",\"children\":[{\"category\":\"Method\",\"children\":[{\"category\":\"Identifier\",\"range\":[4,7]}],\"range\":[0,8]}],\"patch\":\"insert\",\"range\":[0,8]}],\"hasChanges\":true,\"range\":[0,8],\"number\":1}],[{\"terms\":[{\"category\":\"Program\",\"children\":[{\"category\":\"Method\",\"children\":[],\"range\":[8,11]}],\"patch\":\"insert\",\"range\":[8,12]}],\"hasChanges\":true,\"range\":[8,12],\"number\":2}],[{\"terms\":[{\"category\":\"Program\",\"children\":[],\"patch\":\"insert\",\"range\":[12,12]}],\"hasChanges\":true,\"range\":[12,12],\"number\":3}]]}\n"
jsonOutput = "{\"oids\":[\"0000000000000000000000000000000000000000\",\"0000000000000000000000000000000000000000\"],\"paths\":[\"test/fixtures/ruby/method-declaration.A.rb\",\"test/fixtures/ruby/method-declaration.B.rb\"],\"rows\":[[{\"category\":\"Program\",\"start\":[1,1],\"children\":[{\"category\":\"Method\",\"start\":[1,1],\"children\":[{\"replace\":{\"category\":\"Identifier\",\"start\":[1,5],\"end\":[1,8],\"range\":[4,7]}}],\"end\":[2,4],\"range\":[0,8]}],\"end\":[3,1],\"range\":[0,8],\"number\":1},{\"category\":\"Program\",\"start\":[1,1],\"children\":[{\"category\":\"Method\",\"start\":[1,1],\"children\":[{\"replace\":{\"category\":\"Identifier\",\"start\":[1,5],\"end\":[1,8],\"range\":[4,7]}},{\"insert\":{\"category\":\"Params\",\"start\":[1,8],\"children\":[{\"category\":\"Identifier\",\"start\":[1,9],\"end\":[1,10],\"range\":[8,9]}],\"end\":[2,3],\"range\":[7,11]}}],\"end\":[3,4],\"range\":[0,11]}],\"end\":[4,1],\"range\":[0,11],\"number\":1}],[{\"category\":\"Program\",\"start\":[1,1],\"children\":[{\"category\":\"Method\",\"start\":[1,1],\"children\":[{\"insert\":{\"category\":\"Params\",\"start\":[1,8],\"children\":[],\"end\":[2,3],\"range\":[11,13]}},{\"insert\":{\"category\":\"Identifier\",\"start\":[2,3],\"end\":[2,6],\"range\":[13,16]}}],\"end\":[3,4],\"range\":[11,17]}],\"end\":[4,1],\"range\":[11,17],\"number\":2}],[{\"category\":\"Program\",\"start\":[1,1],\"children\":[{\"category\":\"Method\",\"start\":[1,1],\"children\":[],\"end\":[2,4],\"range\":[8,11]}],\"end\":[3,1],\"range\":[8,12],\"number\":2},{\"category\":\"Program\",\"start\":[1,1],\"children\":[{\"category\":\"Method\",\"start\":[1,1],\"children\":[],\"end\":[3,4],\"range\":[17,20]}],\"end\":[4,1],\"range\":[17,21],\"number\":3}],[{\"category\":\"Program\",\"start\":[1,1],\"children\":[],\"end\":[3,1],\"range\":[12,12],\"number\":3},{\"category\":\"Program\",\"start\":[1,1],\"children\":[],\"end\":[4,1],\"range\":[21,21],\"number\":4}]]}\n"
jsonOutput' = "{\"oids\":[\"0000000000000000000000000000000000000000\",\"ff7bbbe9495f61d9e1e58c597502d152bab1761e\"],\"paths\":[\"methods.rb\",\"methods.rb\"],\"rows\":[[{\"insert\":{\"category\":\"Program\",\"start\":[1,1],\"children\":[{\"category\":\"Method\",\"start\":[1,1],\"children\":[{\"category\":\"Identifier\",\"start\":[1,5],\"end\":[1,8],\"range\":[4,7]}],\"end\":[2,4],\"range\":[0,8]}],\"end\":[3,1],\"range\":[0,8]},\"number\":1}],[{\"insert\":{\"category\":\"Program\",\"start\":[1,1],\"children\":[{\"category\":\"Method\",\"start\":[1,1],\"children\":[],\"end\":[2,4],\"range\":[8,11]}],\"end\":[3,1],\"range\":[8,12]},\"number\":2}],[{\"insert\":{\"category\":\"Program\",\"start\":[1,1],\"children\":[],\"end\":[3,1],\"range\":[12,12]},\"number\":3}]]}\n"
sExpressionOutput = "(Program\n (Method\n { (Identifier)\n ->(Identifier) }\n {+(Params\n (Identifier))+}\n {+(Identifier)+}))"
sExpressionOutput' = "{+(Program\n (Method\n (Identifier)))+}"
tocOutput = "{\"changes\":{\"test/fixtures/ruby/method-declaration.A.rb -> test/fixtures/ruby/method-declaration.B.rb\":[{\"span\":{\"start\":[1,1],\"end\":[3,4]},\"category\":\"Method\",\"term\":\"bar\",\"changeType\":\"modified\"}]},\"errors\":{}}\n"