mirror of
				https://github.com/tmux-plugins/tpm.git
				synced 2025-11-04 00:16:05 +00:00 
			
		
		
		
	Refactor test 'expect' scripts
Make test 'expect' scripts simpler and ensure expectations are properly asserted. Closes #46
This commit is contained in:
		@@ -12,50 +12,44 @@ sleep 1
 | 
			
		||||
# this is tmux prefix + U
 | 
			
		||||
send "U"
 | 
			
		||||
 | 
			
		||||
set timeout 5
 | 
			
		||||
set timeout 15
 | 
			
		||||
 | 
			
		||||
expect {
 | 
			
		||||
  "Installed plugins" {
 | 
			
		||||
 | 
			
		||||
    expect {
 | 
			
		||||
      "\"tmux-example-plugin\"" {
 | 
			
		||||
 | 
			
		||||
        expect {
 | 
			
		||||
          "\"all\" - updates all plugins" {
 | 
			
		||||
 | 
			
		||||
            expect { "ENTER - cancels" }
 | 
			
		||||
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  timeout {
 | 
			
		||||
    puts "Plugin update prompt timeout";
 | 
			
		||||
    exit 1
 | 
			
		||||
  }
 | 
			
		||||
expect_after {
 | 
			
		||||
  timeout { exit 1 }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
expect {
 | 
			
		||||
  "Installed plugins"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
expect {
 | 
			
		||||
  "tmux-example-plugin"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
expect {
 | 
			
		||||
  "\"all\" - updates all plugins"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
expect {
 | 
			
		||||
  "ENTER - cancels"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# wait for tmux to display prompt before sending characters
 | 
			
		||||
sleep 1
 | 
			
		||||
send "tmux-example-plugin\r"
 | 
			
		||||
 | 
			
		||||
expect {
 | 
			
		||||
  "Updating \"tmux-example-plugin\"" {
 | 
			
		||||
  "Updating \"tmux-example-plugin\""
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
    expect {
 | 
			
		||||
      "\"tmux-example-plugin\" update success" {
 | 
			
		||||
expect {
 | 
			
		||||
  "\"tmux-example-plugin\" update success"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
        expect { "Done, press ENTER to continue." { exit 0 } }
 | 
			
		||||
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  timeout {
 | 
			
		||||
    puts "Update all plugins timeout";
 | 
			
		||||
    exit 1
 | 
			
		||||
expect {
 | 
			
		||||
  "Done, press ENTER to continue." {
 | 
			
		||||
    exit 0
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
exit 1
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user