coded_chars/
delimiters.rs

1//! Various delimiters.
2
3use crate::escape::{escape, EscapeSequence};
4
5/// Application program command
6pub const APC: EscapeSequence = escape('_');
7
8/// Coding method delimiter
9pub const CMD: EscapeSequence = escape('d');
10
11/// Device control string
12pub const DCS: EscapeSequence = escape('P');
13
14/// Operating system command
15pub const OSC: EscapeSequence = escape(']');
16
17/// Private message
18pub const PM: EscapeSequence = escape('^');
19
20/// Start of string
21pub const SOS: EscapeSequence = escape('X');
22
23/// String terminator
24pub const ST: EscapeSequence = escape('\\');
25
26
27#[cfg(test)]
28mod tests {
29    use crate::escape::escape;
30
31    #[test]
32    fn test_apc() {
33        assert_eq!(super::APC, escape('_'));
34    }
35
36    #[test]
37    fn test_cmd() {
38        assert_eq!(super::CMD, escape('d'));
39    }
40
41    #[test]
42    fn test_dcs() {
43        assert_eq!(super::DCS, escape('P'));
44    }
45
46    #[test]
47    fn test_osc() {
48        assert_eq!(super::OSC, escape(']'));
49    }
50
51    #[test]
52    fn test_pm() {
53        assert_eq!(super::PM, escape('^'));
54    }
55
56    #[test]
57    fn test_sos() {
58        assert_eq!(super::SOS, escape('X'));
59    }
60
61    #[test]
62    fn test_st() {
63        assert_eq!(super::ST, escape('\\'));
64    }
65}