]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/71-config-migrate.t
swap up/down, also modify the testcase
[i3/i3] / testcases / t / 71-config-migrate.t
index 1d81aaac34f905e627db70a32f56fc7cd99fe675..fb331c482229e0b4858d5415482eaf1b76eba718 100644 (file)
@@ -2,7 +2,7 @@
 # vim:ts=4:sw=4:expandtab
 # !NO_I3_INSTANCE! will prevent complete-run.pl from starting i3
 #
-# Tests if i3-migrate-config-to-v4.pl correctly migrates all config file
+# Tests if i3-migrate-config-to-v4 correctly migrates all config file
 # directives and commands
 #
 use i3test;
@@ -27,7 +27,7 @@ sub migrate_config {
     print $fh $config;
     close($fh);
 
-    my $cmd = "sh -c 'exec " . abs_path("../i3-migrate-config-to-v4.pl") . " --v3 <$tmpfile'";
+    my $cmd = "sh -c 'exec " . abs_path("../i3-migrate-config-to-v4") . " --v3 <$tmpfile'";
     return [ split /\n/, qx($cmd) ];
 }
 
@@ -155,7 +155,7 @@ ok(line_exists($output, qr|^bindsym Mod1\+s stack-limit cols 2$|), 'stack-limit
 ok(line_exists($output, qr|^bindsym Mod1\+s stack-limit rows 3$|), 'stack-limit unchanged');
 ok(line_exists($output, qr|^bindcode Mod1\+c exec /usr/bin/urxvt$|), 'bind changed to bindcode');
 ok(line_exists($output, qr|^mode "asdf" {$|), 'mode asdf unchanged');
-ok(line_exists($output, qr|^bindcode 36 mode default$|), 'mode default unchanged');
+ok(line_exists($output, qr|^bindcode 36 mode \"default\"$|), 'mode default unchanged');
 ok(line_exists($output, qr|^}$|), 'closing mode bracket still there');
 
 #####################################################################
@@ -185,6 +185,7 @@ $input = <<EOT;
     bindsym Mod1+s bn
     bindsym Mod1+s bp
     bindsym Mod1+s bb
+    bindsym Mod1+s bt
 
     bindsym Mod1+j wch
     bindsym Mod1+j wcml
@@ -201,7 +202,7 @@ ok(line_exists($output, qr|^bindsym Mod1\+s layout default$|), 'd replaced');
 ok(line_exists($output, qr|^bindsym Mod1\+s layout tabbed$|), 'T replaced');
 ok(line_exists($output, qr|^bindsym Mod1\+s fullscreen$|), 'f replaced');
 ok(line_exists($output, qr|^bindsym Mod1\+s fullscreen global$|), 'fg replaced');
-ok(line_exists($output, qr|^bindsym Mod1\+s focus mode_toggle$|), 't replaced');
+ok(line_exists($output, qr|^bindsym Mod1\+s floating toggle$|), 't replaced');
 ok(line_exists($output, qr|^bindsym Mod1\+s focus left$|), 'h replaced');
 ok(line_exists($output, qr|^bindsym Mod1\+s focus down$|), 'j replaced');
 ok(line_exists($output, qr|^bindsym Mod1\+s focus up$|), 'k replaced');
@@ -213,8 +214,9 @@ ok(line_exists($output, qr|^bindsym Mod1\+s move right$|), 'ml replaced');
 ok(line_exists($output, qr|^bindsym Mod1\+s border normal$|), 'bn replaced');
 ok(line_exists($output, qr|^bindsym Mod1\+s border 1pixel$|), 'bp replaced');
 ok(line_exists($output, qr|^bindsym Mod1\+s border none$|), 'bb replaced');
-ok(line_exists($output, qr|^#.*with container.*obsolete.*wch$|), 'with container removed');
-ok(line_exists($output, qr|^#.*with container.*obsolete.*wcml$|), 'with container removed');
+ok(line_exists($output, qr|^bindsym Mod1\+s border toggle$|), 'bt replaced');
+ok(line_exists($output, qr|^bindsym Mod1\+j focus parent; focus left$|), 'with container replaced with focus parent; focus left');
+ok(line_exists($output, qr|^bindsym Mod1\+j focus parent; move right$|), 'with container replaced with focus parent; move right');
 ok(line_exists($output, qr|^bindsym Mod1\+k kill$|), 'kill unchanged');
 ok(line_exists($output, qr|^bindsym Mod1\+n workspace next$|), 'nw replaced');
 ok(line_exists($output, qr|^bindsym Mod1\+p workspace prev$|), 'pw replaced');
@@ -254,13 +256,13 @@ $output = migrate_config('bindsym Mod1+f resize left +10');
 ok(line_exists($output, qr|^bindsym Mod1\+f resize grow left 10 px$|), 'resize left changed');
 
 $output = migrate_config('bindsym Mod1+f resize top -20');
-ok(line_exists($output, qr|^bindsym Mod1\+f resize shrink top 20 px$|), 'resize top changed');
+ok(line_exists($output, qr|^bindsym Mod1\+f resize shrink up 20 px$|), 'resize top changed');
 
 $output = migrate_config('bindsym Mod1+f resize right -20');
 ok(line_exists($output, qr|^bindsym Mod1\+f resize shrink right 20 px$|), 'resize right changed');
 
 $output = migrate_config('bindsym Mod1+f resize bottom +23');
-ok(line_exists($output, qr|^bindsym Mod1\+f resize grow bottom 23 px$|), 'resize bottom changed');
+ok(line_exists($output, qr|^bindsym Mod1\+f resize grow down 23 px$|), 'resize bottom changed');
 
 #####################################################################
 # check whether jump's parameters get changed correctly
@@ -333,4 +335,11 @@ ok(line_exists($output, qr|i3bar|), 'i3bar added');
 $output = migrate_config('workspace_bar no');
 ok(!line_exists($output, qr|i3bar|), 'no i3bar added');
 
+#####################################################################
+# check whether the mode command gets quotes
+#####################################################################
+
+$output = migrate_config('bindsym Mod1+m mode foobar');
+ok(line_exists($output, qr|^bindsym Mod1\+m mode "foobar"|), 'mode got quotes');
+
 done_testing();