#
use i3test i3_autostart => 0;
use File::Temp qw(tempfile tempdir);
+use File::Basename;
use POSIX qw(getuid);
use v5.10;
# ensure XDG_RUNTIME_DIR is not set
delete $ENV{XDG_RUNTIME_DIR};
-my $pid = launch_with_config($config, dont_add_socket_path => 1);
+my $pid = launch_with_config($config, dont_add_socket_path => 1, dont_create_temp_dir => 1);
+my $socketpath = get_socket_path(0);
my $folder = "/tmp/i3-" . getpwuid(getuid());
+like(dirname($socketpath), qr/^$folder/, 'temp directory matches expected pattern');
+$folder = dirname($socketpath);
+
ok(-d $folder, "folder $folder exists");
-my $socketpath = "$folder/ipc-socket." . $pid;
+$socketpath = "$folder/ipc-socket." . $pid;
ok(-S $socketpath, "file $socketpath exists and is a socket");
exit_gracefully($pid);
$ENV{XDG_RUNTIME_DIR} = $rtdir;
-$pid = launch_with_config($config, dont_add_socket_path => 1);
+$pid = launch_with_config($config, dont_add_socket_path => 1, dont_create_temp_dir => 1);
ok(-d "$rtdir/i3", "$rtdir/i3 exists and is a directory");
$socketpath = "$rtdir/i3/ipc-socket." . $pid;
ipc-socket $socketpath
EOT
-$pid = launch_with_config($config, dont_add_socket_path => 1);
+$pid = launch_with_config($config, dont_add_socket_path => 1, dont_create_temp_dir => 1);
ok(-S $socketpath, "file $socketpath exists and is a socket");