Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

test.unique_name

Rust
  • Python Unavailable
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

View as Markdown

Module
test
Package
libtmux
Source
crates/libtmux/src/test.rs
unique_name ( prefix : &str ) → String
function [source]
function [source]
unique_name

Build a name no other caller in this process will produce.

The name combines the prefix, the process id, and a counter. Unlike a random name it needs no collision check and no random source, and unlike a bare counter it does not collide between concurrent test processes sharing one server.

Examples

use libtmux::test::unique_name;
let first = unique_name("libtmux");
let second = unique_name("libtmux");
assert_ne!(first, second);
assert!(first.starts_with("libtmux-"));

0 declared, 0 inherited

Esc

Type to search.