Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: lib/src/prism/tests/languages/batch/command_feature.test

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/src/prism/tests/languages/batch/command_feature.test
diff --git a/lib/src/prism/tests/languages/batch/command_feature.test b/lib/src/prism/tests/languages/batch/command_feature.test
new file mode 100644
index 0000000000000000000000000000000000000000..350788a8bd980567f6117dd4dcc718b6f9b0ca04
--- /dev/null
+++ b/lib/src/prism/tests/languages/batch/command_feature.test
@@ -0,0 +1,103 @@
+FOR /l %%a in (5,-1,1) do (TITLE %title% -- closing in %%as)
+SET title=%~n0
+echo.Hello World
+@ECHO OFF
+if not defined ProgressFormat set "ProgressFormat=[PPPP]"
+EXIT /b
+set /a ProgressCnt+=1
+IF "%~1" NEQ "" (SET %~1=%new%) ELSE (echo.%new%)
+
+----------------------------------------------------
+
+[
+ ["command", [
+ ["keyword", "FOR"],
+ ["parameter", ["/l"]],
+ ["variable", "%%a"],
+ ["keyword", "in"],
+ ["punctuation", "("],
+ ["number", "5"], ["punctuation", ","],
+ ["number", "-1"], ["punctuation", ","],
+ ["number", "1"], ["punctuation", ")"],
+ ["keyword", "do"]
+ ]],
+ ["punctuation", "("],
+ ["command", [
+ ["keyword", "TITLE"],
+ ["variable", "%title%"],
+ " -- closing in ",
+ ["variable", "%%as"]
+ ]],
+ ["punctuation", ")"],
+
+ ["command", [
+ ["keyword", "SET"],
+ ["variable", "title"],
+ ["operator", "="],
+ ["variable", "%~n0"]
+ ]],
+
+ ["command", [
+ ["keyword", "echo"],
+ ".Hello World"
+ ]],
+
+ ["operator", "@"],
+ ["command", [
+ ["keyword", "ECHO"],
+ " OFF"
+ ]],
+
+ ["command", [
+ ["keyword", "if"],
+ ["keyword", "not"],
+ ["keyword", "defined"],
+ " ProgressFormat"
+ ]],
+ ["command", [
+ ["keyword", "set"],
+ ["string", "\"ProgressFormat=[PPPP]\""]
+ ]],
+
+ ["command", [
+ ["keyword", "EXIT"],
+ ["parameter", ["/b"]]
+ ]],
+
+ ["command", [
+ ["keyword", "set"],
+ ["parameter", ["/a"]],
+ ["variable", "ProgressCnt"],
+ ["operator", "+="],
+ ["number", "1"]
+ ]],
+
+ ["command", [
+ ["keyword", "IF"],
+ ["string", "\"%~1\""],
+ ["operator", "NEQ"],
+ ["string", "\"\""]
+ ]],
+ ["punctuation", "("],
+ ["command", [
+ ["keyword", "SET"],
+ ["variable", "%~1"],
+ ["operator", "="],
+ ["variable", "%new%"]
+ ]],
+ ["punctuation", ")"],
+ ["command", [
+ ["keyword", "ELSE"]
+ ]],
+ ["punctuation", "("],
+ ["command", [
+ ["keyword", "echo"],
+ ".",
+ ["variable", "%new%"]
+ ]],
+ ["punctuation", ")"]
+]
+
+----------------------------------------------------
+
+Checks for commands.
« no previous file with comments | « lib/src/prism/tests/languages/basic/string_feature.test ('k') | lib/src/prism/tests/languages/batch/comment_feature.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698