-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- corresponds first phase in mssql.vbs, no access to db Change-Id: Icca7b3a097d9588842703e79acdeea8f5b6b23c4
- Loading branch information
Showing
4 changed files
with
74 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (C) 2023 Checkmk GmbH - License: GNU General Public License v2 | ||
// This file is part of Checkmk (https://checkmk.com). It is subject to the terms and | ||
// conditions defined in the file COPYING, which is part of this source code package. | ||
|
||
pub fn header(name: &str, separator: Option<char>) -> String { | ||
match separator { | ||
Some(s) => { | ||
let sep = s as u8; | ||
format!("<<<{name}:sep({sep:0>2})>>>\n") | ||
} | ||
None => format!("<<<{name}>>>\n"), | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod test { | ||
use super::*; | ||
#[test] | ||
fn test_header() { | ||
assert_eq!(header("name", Some('\n')), "<<<name:sep(10)>>>\n"); | ||
assert_eq!(header("name", Some('\t')), "<<<name:sep(09)>>>\n"); | ||
assert_eq!(header("name", Some('|')), "<<<name:sep(124)>>>\n"); | ||
assert_eq!(header("name", None), "<<<name>>>\n"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,6 @@ | |
pub mod args; | ||
pub mod config; | ||
mod constants; | ||
pub mod emit; | ||
pub mod ms_sql; | ||
pub mod setup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters