File: remove_extensions.rs

package info (click to toggle)
rust-git2 0.20.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,388 kB
  • sloc: sh: 35; makefile: 6
file content (26 lines) | stat: -rw-r--r-- 632 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//! Test for `set_extensions`, which writes a global state maintained by libgit2

use git2::opts::{get_extensions, set_extensions};
use git2::Error;

#[test]
fn test_remove_extensions() -> Result<(), Error> {
    unsafe {
        set_extensions(&[
            "custom",
            "!ignore",
            "!noop",
            "!objectformat",
            "!preciousobjects",
            "!worktreeconfig",
            "other",
        ])?;
    }

    let extensions = unsafe { get_extensions() }?;
    let extensions: Vec<_> = extensions.iter().collect();

    assert_eq!(extensions, [Some("custom"), Some("other")]);

    Ok(())
}