mirror of
https://github.com/google/blockly.git
synced 2026-01-09 10:00:09 +01:00
JS and Dart generator tests pass
This commit is contained in:
@@ -34,7 +34,7 @@ Blockly.Blocks['unittest_main'] = {
|
||||
this.setTooltip('Executes the enclosed unit tests,\n' +
|
||||
'then prints a summary.');
|
||||
},
|
||||
getVars: function() {
|
||||
getDeveloperVars: function() {
|
||||
return ['unittestResults'];
|
||||
}
|
||||
};
|
||||
@@ -54,7 +54,7 @@ Blockly.Blocks['unittest_assertequals'] = {
|
||||
.appendField('expected');
|
||||
this.setTooltip('Tests that "actual == expected".');
|
||||
},
|
||||
getVars: function() {
|
||||
getDeveloperVars: function() {
|
||||
return ['unittestResults'];
|
||||
}
|
||||
};
|
||||
@@ -74,7 +74,7 @@ Blockly.Blocks['unittest_assertvalue'] = {
|
||||
[['true', 'TRUE'], ['false', 'FALSE'], ['null', 'NULL']]), 'EXPECTED');
|
||||
this.setTooltip('Tests that the value is true, false, or null.');
|
||||
},
|
||||
getVars: function() {
|
||||
getDeveloperVars: function() {
|
||||
return ['unittestResults'];
|
||||
}
|
||||
};
|
||||
@@ -90,7 +90,7 @@ Blockly.Blocks['unittest_fail'] = {
|
||||
.appendField('fail');
|
||||
this.setTooltip('Records an error.');
|
||||
},
|
||||
getVars: function() {
|
||||
getDeveloperVars: function() {
|
||||
return ['unittestResults'];
|
||||
}
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
Blockly.Dart['unittest_main'] = function(block) {
|
||||
// Container for unit tests.
|
||||
var resultsVar = Blockly.Dart.variableDB_.getName('unittestResults',
|
||||
Blockly.Variables.NAME_TYPE);
|
||||
Blockly.Names.DEVELOPER_VARIABLE_TYPE);
|
||||
var functionName = Blockly.Dart.provideFunction_(
|
||||
'unittest_report',
|
||||
[ 'String ' + Blockly.Dart.FUNCTION_NAME_PLACEHOLDER_ + '() {',
|
||||
@@ -71,7 +71,7 @@ Blockly.Dart['unittest_main'] = function(block) {
|
||||
|
||||
Blockly.Dart['unittest_main'].defineAssert_ = function() {
|
||||
var resultsVar = Blockly.Dart.variableDB_.getName('unittestResults',
|
||||
Blockly.Variables.NAME_TYPE);
|
||||
Blockly.Names.DEVELOPER_VARIABLE_TYPE);
|
||||
var functionName = Blockly.Dart.provideFunction_(
|
||||
'unittest_assertequals',
|
||||
[ 'void ' + Blockly.Dart.FUNCTION_NAME_PLACEHOLDER_ +
|
||||
@@ -139,7 +139,7 @@ Blockly.Dart['unittest_assertvalue'] = function(block) {
|
||||
Blockly.Dart['unittest_fail'] = function(block) {
|
||||
// Always assert an error.
|
||||
var resultsVar = Blockly.Dart.variableDB_.getName('unittestResults',
|
||||
Blockly.Variables.NAME_TYPE);
|
||||
Blockly.Names.DEVELOPER_VARIABLE_TYPE);
|
||||
var message = Blockly.Dart.quote_(block.getFieldValue('MESSAGE'));
|
||||
var functionName = Blockly.Dart.provideFunction_(
|
||||
'unittest_fail',
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
Blockly.JavaScript['unittest_main'] = function(block) {
|
||||
// Container for unit tests.
|
||||
var resultsVar = Blockly.JavaScript.variableDB_.getName('unittestResults',
|
||||
Blockly.Variables.NAME_TYPE);
|
||||
Blockly.Names.DEVELOPER_VARIABLE_TYPE);
|
||||
var functionName = Blockly.JavaScript.provideFunction_(
|
||||
'unittest_report',
|
||||
[ 'function ' + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + '() {',
|
||||
@@ -72,7 +72,7 @@ Blockly.JavaScript['unittest_main'] = function(block) {
|
||||
|
||||
Blockly.JavaScript['unittest_main'].defineAssert_ = function(block) {
|
||||
var resultsVar = Blockly.JavaScript.variableDB_.getName('unittestResults',
|
||||
Blockly.Variables.NAME_TYPE);
|
||||
Blockly.Names.DEVELOPER_VARIABLE_TYPE);
|
||||
var functionName = Blockly.JavaScript.provideFunction_(
|
||||
'assertEquals',
|
||||
[ 'function ' + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ +
|
||||
@@ -143,7 +143,7 @@ Blockly.JavaScript['unittest_assertvalue'] = function(block) {
|
||||
Blockly.JavaScript['unittest_fail'] = function(block) {
|
||||
// Always assert an error.
|
||||
var resultsVar = Blockly.JavaScript.variableDB_.getName('unittestResults',
|
||||
Blockly.Variables.NAME_TYPE);
|
||||
Blockly.Names.DEVELOPER_VARIABLE_TYPE);
|
||||
var message = Blockly.JavaScript.quote_(block.getFieldValue('MESSAGE'));
|
||||
var functionName = Blockly.JavaScript.provideFunction_(
|
||||
'unittest_fail',
|
||||
|
||||
Reference in New Issue
Block a user