Skip to content

Commit 78d866a

Browse files
committed
tests(nmrs): .ovpn parser tests and refactored logic in arms
1 parent 689bd8b commit 78d866a

2 files changed

Lines changed: 403 additions & 40 deletions

File tree

nmrs/src/core/ovpn_parser/error.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ pub enum OvpnParseError {
1212
arg: String,
1313
line: usize,
1414
},
15+
MissingArgument {
16+
key: String,
17+
line: usize,
18+
},
1519
InvalidContinuation {
1620
line: usize,
1721
},
@@ -45,6 +49,9 @@ impl fmt::Display for OvpnParseError {
4549
"invalid argument '{arg}' for directive '{key}' at line {line}"
4650
)
4751
}
52+
OvpnParseError::MissingArgument { key, line } => {
53+
write!(f, "missing argument for directive '{key}' at line {line}")
54+
}
4855
OvpnParseError::InvalidContinuation { line } => {
4956
write!(f, "invalid continuation at line {line}")
5057
}

0 commit comments

Comments
 (0)