coded_chars/
introducers.rs

1//! Control sequence and other introducers.
2
3use crate::escape::{escape, EscapeSequence};
4
5/// Control sequence identifier
6pub const CSI: EscapeSequence = escape('[');
7
8/// # Escape
9///
10/// ESC is used for code extension purposes. It causes the meanings of a limited number of bit combinations
11/// following it in the data stream to be changed.
12///
13/// The use of ESC is defined in Standard ECMA-35.
14pub const ESC:char = '\x1B';
15
16/// Single character introducer
17pub const SCI: EscapeSequence = escape('Z');
18
19
20#[cfg(test)]
21mod tests {
22    use super::*;
23
24    #[test]
25    fn test_csi_escape_sequence() {
26        let expected = EscapeSequence::new('['); // Assuming EscapeSequence has a `new` function
27        assert_eq!(CSI, expected, "CSI escape sequence should match the expected value");
28    }
29
30    #[test]
31    fn test_sci_escape_sequence() {
32        let expected = EscapeSequence::new('Z'); // Assuming EscapeSequence has a `new` function
33        assert_eq!(SCI, expected, "SCI escape sequence should match the expected value");
34    }
35
36    #[test]
37    fn test_esc_character() {
38        assert_eq!(ESC, '\x1B', "ESC character should be the ASCII Escape character");
39    }
40}