aboutsummaryrefslogtreecommitdiff
path: root/parser-specs
diff options
context:
space:
mode:
authorhwangcc23 <hwangcc@csie.nctu.edu.tw>2017-06-11 23:48:55 +0800
committerhwangcc23 <hwangcc@csie.nctu.edu.tw>2017-06-12 22:21:21 +0800
commitcc4be4167422644c5789b94ec6292e5c77d2df45 (patch)
tree0006f696566a5f64d2a06ee31a1322cebb4530e8 /parser-specs
parentd3901fe92ebb86edc9d3f77d8ab4fa8645778761 (diff)
downloadi3-cc4be4167422644c5789b94ec6292e5c77d2df45.tar.gz
i3-cc4be4167422644c5789b94ec6292e5c77d2df45.zip
Fix 'rename workspace to tosomething'
This patch fixes the issue #2802 (https://github.com/i3/i3/issues/2802). 1). Revise the state machine for the 'rename workspace' command. These scenarios are considered: a). 'rename workspace to to bla' state transitions: RENAME -> RENAME_WORKSPACE -> RENAME_WORKSPACE_LIKELY_TO -> RENAME_WORKSPACE_LIKELY_TO_NEW_NAME b). 'rename workspace to tosomething' state transitions: RENAME -> RENAME_WORKSPACE -> RENAME_WORKSPACE_LIKELY_TO c). 'rename workspace to to' state transitions: RENAME -> RENAME_WORKSPACE -> RENAME_WORKSPACE_LIKELY_TO d). 'rename workspace to bla' state transitions: RENAME -> RENAME_WORKSPACE -> RENAME_WORKSPACE_LIKELY_TO e). 'rename workspace bla to foo' state transitions: RENAME -> RENAME_WORKSPACE -> RENAME_WORKSPACE_TO -> RENAME_WORKSPACE_TO_NEW_NAME 2). Add a test case in 117-workspace.t for the scenario b.
Diffstat (limited to 'parser-specs')
-rw-r--r--parser-specs/commands.spec18
1 files changed, 11 insertions, 7 deletions
diff --git a/parser-specs/commands.spec b/parser-specs/commands.spec
index 0858322b..a5873328 100644
--- a/parser-specs/commands.spec
+++ b/parser-specs/commands.spec
@@ -274,24 +274,28 @@ state RENAME:
-> RENAME_WORKSPACE
state RENAME_WORKSPACE:
- old_name = 'to'
+ 'to'
-> RENAME_WORKSPACE_LIKELY_TO
old_name = word
-> RENAME_WORKSPACE_TO
state RENAME_WORKSPACE_LIKELY_TO:
- 'to'
- -> RENAME_WORKSPACE_NEW_NAME
+ 'to '
+ -> RENAME_WORKSPACE_LIKELY_TO_NEW_NAME
new_name = word
-> call cmd_rename_workspace(NULL, $new_name)
+state RENAME_WORKSPACE_LIKELY_TO_NEW_NAME:
+ new_name = string
+ -> call cmd_rename_workspace("to", $new_name)
+ end
+ -> call cmd_rename_workspace(NULL, "to")
+
state RENAME_WORKSPACE_TO:
'to'
- -> RENAME_WORKSPACE_NEW_NAME
+ -> RENAME_WORKSPACE_TO_NEW_NAME
-state RENAME_WORKSPACE_NEW_NAME:
- end
- -> call cmd_rename_workspace(NULL, "to")
+state RENAME_WORKSPACE_TO_NEW_NAME:
new_name = string
-> call cmd_rename_workspace($old_name, $new_name)