mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Improvements to the generator test framework.
This commit is contained in:
@@ -147,7 +147,7 @@ function setOutput(text) {
|
||||
}
|
||||
|
||||
function toXml() {
|
||||
var xmlDom = Blockly.Xml.workspaceToDom(workspace);
|
||||
var xmlDom = Blockly.Xml.workspaceToDom(workspace, /* opt_noId */ true);
|
||||
var xmlText = Blockly.Xml.domToPrettyText(xmlDom);
|
||||
xmlText = xmlText.replace(/ id="\d+"/g, '');
|
||||
setOutput(xmlText);
|
||||
@@ -238,6 +238,7 @@ h1 {
|
||||
</category>
|
||||
<category name="Logic" colour="210">
|
||||
<block type="controls_if"></block>
|
||||
<block type="controls_ifelse"></block>
|
||||
<block type="logic_compare"></block>
|
||||
<block type="logic_operation"></block>
|
||||
<block type="logic_negate"></block>
|
||||
@@ -307,6 +308,8 @@ h1 {
|
||||
<table height="95%" width="30%"><tr><td valign="top">
|
||||
<h1>Blockly Generator Tests</h1>
|
||||
|
||||
<p><a href="https://developers.google.com/blockly/guides/modify/web/unit-testing">See the docs</a> for details on running the tests.
|
||||
|
||||
<p>
|
||||
<select id="testUrl">
|
||||
<option value="logic.xml">Logic</option>
|
||||
@@ -332,11 +335,26 @@ h1 {
|
||||
<p>
|
||||
Generate:
|
||||
<input type="button" value="XML" onclick="toXml()">
|
||||
<input type="button" value="JavaScript" onclick="toJavaScript()">
|
||||
<input type="button" value="Python" onclick="toPython()">
|
||||
<input type="button" value="PHP" onclick="toPhp()">
|
||||
<input type="button" value="Lua" onclick="toLua()">
|
||||
<input type="button" value="Dart" onclick="toDart()">
|
||||
<div style="display: inline-block;">
|
||||
<input type="button" value="JavaScript" onclick="toJavaScript()">
|
||||
<br><a target="_blank" href="https://repl.it/languages/javascript">interpreter</a>
|
||||
</div>
|
||||
<div style="display: inline-block;">
|
||||
<input type="button" value="Python" onclick="toPython()">
|
||||
<br><a target="_blank" href="https://repl.it/languages/python">interpreter</a>
|
||||
</div>
|
||||
<div style="display: inline-block;">
|
||||
<input type="button" value="PHP" onclick="toPhp()">
|
||||
<br><a target="_blank" href="https://repl.it/languages/php">interpreter</a>
|
||||
</div>
|
||||
<div style="display: inline-block;">
|
||||
<input type="button" value="Lua" onclick="toLua()">
|
||||
<br><a target="_blank" href="https://repl.it/languages/lua">interpreter</a>
|
||||
</div>
|
||||
<div style="display: inline-block;">
|
||||
<input type="button" value="Dart" onclick="toDart()">
|
||||
<br><a target="_blank" href="https://dartpad.dartlang.org/">interpreter</a>
|
||||
</div>
|
||||
</p>
|
||||
</td></tr><tr><td height="99%">
|
||||
<textarea id="importExport" readonly="readonly" wrap="off"></textarea>
|
||||
|
||||
Reference in New Issue
Block a user