Lines Matching refs:Ok

27 /// assert_eq!(parser("abc"), Ok(("bc", 'a')));
41 Some((c, true)) => Ok((i.slice(c.len()..), c.as_char())),
57 /// assert_eq!(parser("abc"), Ok(("bc", 'a')));
72 Some((c, true)) => Ok((i.slice(c.len()..), c)),
85 /// assert_eq!(one_of::<_, _, (&str, ErrorKind)>("abc")("b"), Ok(("", 'b')));
96 Some((c, true)) => Ok((i.slice(c.len()..), c.as_char())),
109 /// assert_eq!(none_of::<_, _, (&str, ErrorKind)>("abc")("z"), Ok(("", 'z')));
120 Some((c, true)) => Ok((i.slice(c.len()..), c.as_char())),
137 /// assert_eq!(parser("\r\nc"), Ok(("c", "\r\n")));
149 CompareResult::Ok => Ok((input.slice(2..), input.slice(0..2))),
170 /// assert_eq!(parser("ab\r\nc"), Ok(("\r\nc", "ab")));
171 /// assert_eq!(parser("ab\nc"), Ok(("\nc", "ab")));
172 /// assert_eq!(parser("abc"), Ok(("", "abc")));
173 /// assert_eq!(parser(""), Ok(("", "")));
189 None => Ok((input.slice(input.input_len()..), input)),
198 CompareResult::Ok => Ok((input.slice(index..), input.slice(..index))),
205 Ok((input.slice(index..), input.slice(..index)))
223 /// assert_eq!(parser("\r\nc"), Ok(("c", "\r\n")));
234 CompareResult::Ok => Ok((input.slice(1..), input.slice(0..1))),
239 CompareResult::Ok => Ok((input.slice(2..), input.slice(0..2))),
258 /// assert_eq!(parser("\nc"), Ok(("c", '\n')));
282 /// assert_eq!(parser("\tc"), Ok(("c", '\t')));
306 /// assert_eq!(parser("abc"), Ok(("bc",'a')));
318 None => Ok((input.slice(input.input_len()..), c.as_char())),
319 Some((idx, _)) => Ok((input.slice(idx..), c.as_char())),
337 /// assert_eq!(parser("ab1c"), Ok(("1c", "ab")));
338 /// assert_eq!(parser("1c"), Ok(("1c", "")));
339 /// assert_eq!(parser(""), Ok(("", "")));
362 /// assert_eq!(parser("aB1c"), Ok(("1c", "aB")));
387 /// assert_eq!(parser("21c"), Ok(("c", "21")));
388 /// assert_eq!(parser("21"), Ok(("", "21")));
389 /// assert_eq!(parser("a21c"), Ok(("a21c", "")));
390 /// assert_eq!(parser(""), Ok(("", "")));
413 /// assert_eq!(parser("21c"), Ok(("c", "21")));
429 /// assert_eq!(parser("416"), Ok(("", 416)));
430 /// assert_eq!(parser("12b"), Ok(("b", 12)));
455 /// assert_eq!(parser("21cZ"), Ok(("Z", "21c")));
456 /// assert_eq!(parser("Z21c"), Ok(("Z21c", "")));
457 /// assert_eq!(parser(""), Ok(("", "")));
479 /// assert_eq!(parser("21cZ"), Ok(("Z", "21c")));
504 /// assert_eq!(parser("21cZ"), Ok(("cZ", "21")));
505 /// assert_eq!(parser("Z21c"), Ok(("Z21c", "")));
506 /// assert_eq!(parser(""), Ok(("", "")));
529 /// assert_eq!(parser("21cZ"), Ok(("cZ", "21")));
554 /// assert_eq!(parser("21cZ%1"), Ok(("%1", "21cZ")));
555 /// assert_eq!(parser("&Z21c"), Ok(("&Z21c", "")));
556 /// assert_eq!(parser(""), Ok(("", "")));
579 /// assert_eq!(parser("21cZ%1"), Ok(("%1", "21cZ")));
604 /// assert_eq!(parser(" \t21c"), Ok(("21c", " \t")));
605 /// assert_eq!(parser("Z21c"), Ok(("Z21c", "")));
606 /// assert_eq!(parser(""), Ok(("", "")));
632 /// assert_eq!(parser(" \t21c"), Ok(("21c", " \t")));
663 /// assert_eq!(parser(" \t\n\r21c"), Ok(("21c", " \t\n\r")));
664 /// assert_eq!(parser("Z21c"), Ok(("Z21c", "")));
665 /// assert_eq!(parser(""), Ok(("", "")));
691 /// assert_eq!(parser(" \t\n\r21c"), Ok(("21c", " \t\n\r")));
723 Ok((i, sign))
753 return Ok((i.slice(pos..), value));
769 return Ok((i.slice(pos..), value));
780 Ok((i.slice(i.input_len()..), value))
813 return Ok((i.slice(pos..), value));
823 Ok((i.slice(i.input_len()..), value))
855 assert_parse!(alpha1(a), Ok((empty, a)));
857 assert_eq!(alpha1::<_, (_, ErrorKind)>(c), Ok((&c[1..], &b"a"[..])));
860 Ok(("é12".as_bytes(), &b"az"[..]))
863 assert_eq!(digit1::<_, (_, ErrorKind)>(b), Ok((empty, b)));
866 assert_eq!(hex_digit1::<_, (_, ErrorKind)>(a), Ok((empty, a)));
867 assert_eq!(hex_digit1::<_, (_, ErrorKind)>(b), Ok((empty, b)));
868 assert_eq!(hex_digit1::<_, (_, ErrorKind)>(c), Ok((empty, c)));
871 Ok(("zé12".as_bytes(), &b"a"[..]))
875 assert_eq!(oct_digit1::<_, (_, ErrorKind)>(b), Ok((empty, b)));
878 assert_eq!(alphanumeric1::<_, (_, ErrorKind)>(a), Ok((empty, a)));
879 //assert_eq!(fix_error!(b,(), alphanumeric), Ok((empty, b)));
880 assert_eq!(alphanumeric1::<_, (_, ErrorKind)>(c), Ok((empty, c)));
883 Ok(("é12".as_bytes(), &b"az"[..]))
885 assert_eq!(space1::<_, (_, ErrorKind)>(e), Ok((empty, e)));
886 assert_eq!(space1::<_, (_, ErrorKind)>(f), Ok((&b";"[..], &b" "[..])));
898 assert_eq!(alpha1::<_, (_, ErrorKind)>(a), Ok((empty, a)));
900 assert_eq!(alpha1::<_, (_, ErrorKind)>(c), Ok((&c[1..], &"a"[..])));
901 assert_eq!(alpha1::<_, (_, ErrorKind)>(d), Ok(("é12", &"az"[..])));
903 assert_eq!(digit1::<_, (_, ErrorKind)>(b), Ok((empty, b)));
906 assert_eq!(hex_digit1::<_, (_, ErrorKind)>(a), Ok((empty, a)));
907 assert_eq!(hex_digit1::<_, (_, ErrorKind)>(b), Ok((empty, b)));
908 assert_eq!(hex_digit1::<_, (_, ErrorKind)>(c), Ok((empty, c)));
909 assert_eq!(hex_digit1::<_, (_, ErrorKind)>(d), Ok(("zé12", &"a"[..])));
912 assert_eq!(oct_digit1::<_, (_, ErrorKind)>(b), Ok((empty, b)));
915 assert_eq!(alphanumeric1::<_, (_, ErrorKind)>(a), Ok((empty, a)));
916 //assert_eq!(fix_error!(b,(), alphanumeric), Ok((empty, b)));
917 assert_eq!(alphanumeric1::<_, (_, ErrorKind)>(c), Ok((empty, c)));
918 assert_eq!(alphanumeric1::<_, (_, ErrorKind)>(d), Ok(("é12", "az")));
919 assert_eq!(space1::<_, (_, ErrorKind)>(e), Ok((empty, e)));
933 Ok((i, _)) => {
939 Ok((i, _)) => {
945 Ok((i, _)) => {
951 Ok((i, _)) => {
957 Ok((i, _)) => {
963 Ok((i, _)) => {
969 Ok((i, _)) => {
981 Ok((&b"\nefgh"[..], &b"ab12cd"[..]))
987 Ok((&b"\nefgh\nijkl"[..], &b"ab12cd"[..]))
993 Ok((&b"\r\nefgh\nijkl"[..], &b"ab12cd"[..]))
999 Ok((&[][..], &d[..]))
1007 assert_eq!(not_line_ending(a), Ok((&"\nefgh"[..], &"ab12cd"[..])));
1010 assert_eq!(not_line_ending(b), Ok((&"\nefgh\nijkl"[..], &"ab12cd"[..])));
1013 assert_eq!(not_line_ending(c), Ok((&"\r\nefgh\nijkl"[..], &"ab12cd"[..])));
1016 assert_eq!(not_line_ending(d), Ok((&"\nÂßÇáƒƭèř"[..], &"βèƒôřè"[..])));
1019 assert_eq!(not_line_ending(e), Ok((&"\r\nÂßÇáƒƭèř"[..], &"βèƒôřè"[..])));
1026 assert_eq!(not_line_ending::<_, (_, ErrorKind)>(g2), Ok(("", g2)));
1032 assert_parse!(hex_digit1(i), Ok((&b";"[..], &i[..i.len() - 1])));
1063 assert_parse!(oct_digit1(i), Ok((&b";"[..], &i[..i.len() - 1])));
1091 assert_eq!(output, Ok((&b""[..], (&b"abc"[..], &b"\r\n"[..]))));
1102 assert_eq!(output, Ok((&b""[..], (&b"abc"[..], &b"\n"[..]))));
1109 assert_parse!(output, Ok((&b""[..], &b"\r\n"[..])));
1116 assert_parse!(output, Ok((&b""[..], &b"\n"[..])));
1121 assert_parse!(crlf(&b"\r\na"[..]), Ok((&b"a"[..], &b"\r\n"[..])));
1131 assert_parse!(crlf("\r\na"), Ok(("a", "\r\n")));
1144 assert_parse!(line_ending(&b"\na"[..]), Ok((&b"a"[..], &b"\n"[..])));
1145 assert_parse!(line_ending(&b"\r\na"[..]), Ok((&b"a"[..], &b"\r\n"[..])));
1155 assert_parse!(line_ending("\na"), Ok(("a", "\n")));
1156 assert_parse!(line_ending("\r\na"), Ok(("a", "\r\n")));
1177 Ok((i, s)) => (i, s),
1189 Ok((i, n))
1191 Ok((i, -n))
1204 Some(n) => Ok((i, n)),