From e6e92818bf8b9caa5ac80ce498206428ae1981ce Mon Sep 17 00:00:00 2001 From: shruti2522 Date: Sun, 19 May 2024 22:50:33 +0530 Subject: [PATCH] updated tests Signed-off-by: shruti2522 --- kclvm/tools/src/LSP/src/hover.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/kclvm/tools/src/LSP/src/hover.rs b/kclvm/tools/src/LSP/src/hover.rs index 4cf9fe964..00ae5ee36 100644 --- a/kclvm/tools/src/LSP/src/hover.rs +++ b/kclvm/tools/src/LSP/src/hover.rs @@ -366,7 +366,7 @@ mod tests { lsp_types::HoverContents::Array(vec) => { assert_eq!(vec.len(), 2); if let MarkedString::String(s) = vec[0].clone() { - assert_eq!(s, "```kcl\nfn encode(```kcl\nvalue: str\n```, ```kcl\nencoding: str\n```) -> ```kcl\nstr\n```"); + assert_eq!(s, "```kcl\nfn encode\n```(```kcl\nvalue: str\n```, ```kcl\nencoding: str\n```)```kcl\n -> str\n```"); } if let MarkedString::String(s) = vec[1].clone() { assert_eq!( @@ -389,10 +389,10 @@ mod tests { lsp_types::HoverContents::Array(vec) => { assert_eq!(vec.len(), 3); if let MarkedString::String(s) = vec[0].clone() { - assert_eq!(s, "```kcl\nstr\n```\n\n"); + assert_eq!(s, "```kcl\nstr\n\n\n```"); } if let MarkedString::String(s) = vec[1].clone() { - assert_eq!(s, "```kcl\nfn count(```kcl\nsub: str\n```, ```kcl\nstart: int\n```, ```kcl\nend: int\n```) -> ```kcl\nint\n```"); + assert_eq!(s, "```kcl\nfn count\n```(```kcl\nsub: str\n```, ```kcl\nstart: int\n```, ```kcl\nend: int\n```)```kcl\n -> int\n```"); } if let MarkedString::String(s) = vec[2].clone() { assert_eq!(s, "Return the number of non-overlapping occurrences of substring sub in the range [start, end]. Optional arguments start and end are interpreted as in slice notation."); @@ -412,7 +412,7 @@ mod tests { lsp_types::HoverContents::Array(vec) => { assert_eq!(vec.len(), 2); if let MarkedString::String(s) = vec[0].clone() { - assert_eq!(s, "```kcl\nfn print() -> ```kcl\nNoneType\n```"); + assert_eq!(s, "```kcl\nfn print\n```()```kcl\n -> NoneType\n```"); } if let MarkedString::String(s) = vec[1].clone() { assert_eq!(s, "Prints the values to a stream, or to the system stdout by default.\n\nOptional keyword arguments:\n\nsep: string inserted between values, default a space.\n\nend: string appended after the last value, default a newline."); @@ -476,10 +476,10 @@ mod tests { lsp_types::HoverContents::Array(vec) => { assert_eq!(vec.len(), 3); if let MarkedString::String(s) = vec[0].clone() { - assert_eq!(s, "```kcl\nstr\n```\n\n"); + assert_eq!(s, "```kcl\nstr\n\n\n```"); } if let MarkedString::String(s) = vec[1].clone() { - assert_eq!(s, "```kcl\nfn capitalize() -> ```kcl\nstr\n```"); + assert_eq!(s, "```kcl\nfn capitalize\n```()```kcl\n -> str\n```"); } if let MarkedString::String(s) = vec[2].clone() { assert_eq!(s, "Return a copy of the string with its first character capitalized and the rest lowercased."); @@ -567,7 +567,7 @@ mod tests { }; let got = hover(&program, &pos, &gs).unwrap(); let expect_content = vec![MarkedString::String( - "```kcl\nfn deprecated(```kcl\nversion: str\n```, ```kcl\nreason: str\n```, ```kcl\nstrict: bool\n```) -> ```kcl\nany\n```".to_string(), + "```kcl\nfn deprecated\n```(```kcl\nversion: str\n```, ```kcl\nreason: str\n```, ```kcl\nstrict: bool\n```)```kcl\n -> any\n```".to_string(), ), MarkedString::String( "This decorator is used to get the deprecation message according to the wrapped key-value pair.".to_string(), )];