File: const.rs

package info (click to toggle)
rust-git-testament 0.2.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 128 kB
  • sloc: makefile: 2
file content (27 lines) | stat: -rw-r--r-- 564 bytes parent folder | download
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
27
use git_testament::{git_testament, git_testament_macros};

git_testament!(TESTAMENT);

git_testament_macros!(TESTAMENT);

const TESTAMENT_BRANCH_NAME_OR_DEFAULT: &str = {
    match TESTAMENT.branch_name {
        Some(branch_name) => branch_name,
        None => "main",
    }
};

const MACROS_BRANCH_NAME_OR_DEFAULT: &str = {
    match TESTAMENT_branch!() {
        Some(branch_name) => branch_name,
        None => "main",
    }
};

#[test]
fn it_works() {
    assert_eq!(
        TESTAMENT_BRANCH_NAME_OR_DEFAULT,
        MACROS_BRANCH_NAME_OR_DEFAULT
    );
}