Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
inclyc committed Aug 11, 2024
1 parent cc9e61d commit 2fc96ae
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions nixd/tools/nixd/test/utf16.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# RUN: nixd --lit-test < %s | FileCheck %s

<-- initialize(0)

```json
{
"jsonrpc":"2.0",
"id":0,
"method":"initialize",
"params":{
"processId":123,
"rootPath":"",
"capabilities":{
},
"trace":"off"
}
}
```

```json
{
"jsonrpc":"2.0",
"method":"textDocument/didOpen",
"params":{
"textDocument":{
"uri":"file:///basic.nix",
"languageId":"nix",
"version":1,
"text":"{ a = 1; 测试文本 }"
}
}
}
```

```
CHECK: "code": "parse-unexpected",
CHECK-NEXT: "message": "unexpected text (fix available)",
CHECK-NEXT: "range": {
CHECK-NEXT: "end": {
CHECK-NEXT: "character": 13,
CHECK-NEXT: "line": 0
CHECK-NEXT: },
CHECK-NEXT: "start": {
CHECK-NEXT: "character": 9,
CHECK-NEXT: "line": 0
CHECK-NEXT: }
CHECK-NEXT: },
```

```json
{"jsonrpc":"2.0","method":"exit"}
```

0 comments on commit 2fc96ae

Please sign in to comment.