mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	new test case and indentation fix
This commit is contained in:
		
							parent
							
								
									b011ddfae3
								
							
						
					
					
						commit
						ebdebc7c12
					
				| @ -228,6 +228,28 @@ BOOST_AUTO_TEST_CASE(function_type) | ||||
| 	BOOST_CHECK_EQUAL(funType["attributes"]["visibility"], "external"); | ||||
| } | ||||
| 
 | ||||
| BOOST_AUTO_TEST_CASE(documentation) | ||||
| { | ||||
| 	CompilerStack c; | ||||
| 	c.addSource("a", "/**This contract is empty*/ contract C {}"); | ||||
| 	c.addSource("b", | ||||
| 		"/**This contract is empty" | ||||
| 		" and has a line-breaking comment.*/" | ||||
| 		"contract C {}" | ||||
| 	); | ||||
| 	c.parseAndAnalyze(); | ||||
| 	map<string, unsigned> sourceIndices; | ||||
| 	sourceIndices["a"] = 0; | ||||
| 	sourceIndices["b"] = 1; | ||||
| 	Json::Value astJsonA = ASTJsonConverter(true, sourceIndices).toJson(c.ast("a")); | ||||
| 	Json::Value documentationA = astJsonA["children"][0]["attributes"]["documentation"]; | ||||
| 	BOOST_CHECK_EQUAL(documentationA, "This contract is empty"); | ||||
| 	Json::Value astJsonB = ASTJsonConverter(true, sourceIndices).toJson(c.ast("b")); | ||||
| 	Json::Value documentationB = astJsonB["children"][0]["attributes"]["documentation"]; | ||||
| 	BOOST_CHECK_EQUAL(documentationB, "This contract is empty and has a line-breaking comment."); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| BOOST_AUTO_TEST_SUITE_END() | ||||
| 
 | ||||
| } | ||||
|  | ||||
| @ -90,11 +90,11 @@ BOOST_AUTO_TEST_CASE(basic_compilation) | ||||
| 	BOOST_CHECK(result["sources"]["fileA"].isObject()); | ||||
| 	BOOST_CHECK(result["sources"]["fileA"]["AST"].isObject()); | ||||
| 	BOOST_CHECK(dev::jsonCompactPrint(result["sources"]["fileA"]["AST"]) == | ||||
|                 "{\"attributes\":{\"absolutePath\":\"fileA\",\"exportedSymbols\":{\"A\":[1]}}," | ||||
|                 "\"children\":[{\"attributes\":{\"baseContracts\":[null],\"contractDependencies\":[null]," | ||||
| 		"{\"attributes\":{\"absolutePath\":\"fileA\",\"exportedSymbols\":{\"A\":[1]}}," | ||||
| 		"\"children\":[{\"attributes\":{\"baseContracts\":[null],\"contractDependencies\":[null]," | ||||
| 		"\"contractKind\":\"contract\",\"documentation\":null,\"fullyImplemented\":true,\"linearizedBaseContracts\":[1]," | ||||
|                 "\"name\":\"A\",\"nodes\":[null],\"scope\":2},\"id\":1,\"name\":\"ContractDefinition\"," | ||||
|                 "\"src\":\"0:14:0\"}],\"id\":2,\"name\":\"SourceUnit\",\"src\":\"0:14:0\"}"); | ||||
| 		"\"name\":\"A\",\"nodes\":[null],\"scope\":2},\"id\":1,\"name\":\"ContractDefinition\"," | ||||
| 		"\"src\":\"0:14:0\"}],\"id\":2,\"name\":\"SourceUnit\",\"src\":\"0:14:0\"}"); | ||||
| } | ||||
| BOOST_AUTO_TEST_SUITE_END() | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user