Skip to content

Commit

Permalink
temp: test
Browse files Browse the repository at this point in the history
  • Loading branch information
ZEROM22 committed Dec 20, 2024
1 parent 5b9bb2d commit 5e5e9ab
Show file tree
Hide file tree
Showing 86 changed files with 3,344 additions and 5 deletions.
26 changes: 22 additions & 4 deletions packages/typedoc-signature/fixtures/000/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ import {
TypeToken,
} from "@onlyoffice/signature"

export const name = "transforms an empty project"

export const collection: Entity[] = []
export const name = "computing the signature for functions without parameters"
export const collection: DeclarationEntity[] = []

let e0: Entity
let s: Signature = []
Expand Down Expand Up @@ -50,6 +49,25 @@ t = new TypeToken()
t.text = "void"
s.push(t)

e0.declaration.signature.verbose = s
e0.declaration.signature.verbose.push(...s)
s = []

t = new TextToken()
t.text = "("
s.push(t)

t = new TextToken()
t.text = ")"
s.push(t)

e0.declaration.signature.concise.push(...s)
s = []

t = new TypeToken()
t.text = "void"
s.push(t)

e0.declaration.returns.signature.concise.push(...s)
s = []

collection.push(e0)
2 changes: 1 addition & 1 deletion packages/typedoc-signature/fixtures/000/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"files": ["main.ts"]
"exclude": ["test.ts"]
}
1 change: 1 addition & 0 deletions packages/typedoc-signature/fixtures/001/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function f(p0: string): void {}
104 changes: 104 additions & 0 deletions packages/typedoc-signature/fixtures/001/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import {
type Entity,
DeclarationEntity,
Fragment,
} from "@onlyoffice/library-declaration/next.ts"
import {
EntityToken,
KeywordToken,
ParameterToken,
type Signature,
TextToken,
type Token,
TypeToken,
} from "@onlyoffice/signature"

export const name = "computing the signature for functions with one parameter"
export const collection: DeclarationEntity[] = []

let e0: Entity
let f0: Fragment
let s: Signature = []
let t: Token

e0 = new DeclarationEntity()
e0.id = 2

f0 = new Fragment()
f0.name = "p0"

t = new TypeToken()
t.text = "string"
s.push(t)

f0.signature.concise.push(...s)
s = []

e0.declaration.parameters.push(f0)

t = new KeywordToken()
t.text = "function"
s.push(t)

t = new TextToken()
t.text = " "
s.push(t)

t = new EntityToken()
t.text = "f"
s.push(t)

t = new TextToken()
t.text = "("
s.push(t)

t = new ParameterToken()
t.text = "p0"
s.push(t)

t = new TextToken()
t.text = ": "
s.push(t)

t = new TypeToken()
t.text = "string"
s.push(t)

t = new TextToken()
t.text = ")"
s.push(t)

t = new TextToken()
t.text = ": "
s.push(t)

t = new TypeToken()
t.text = "void"
s.push(t)

e0.declaration.signature.verbose.push(...s)
s = []

t = new TextToken()
t.text = "("
s.push(t)

t = new TextToken()
t.text = "p0"
s.push(t)

t = new TextToken()
t.text = ")"
s.push(t)

e0.declaration.signature.concise.push(...s)
s = []

t = new TypeToken()
t.text = "void"
s.push(t)

e0.declaration.returns.signature.concise.push(...s)
s = []

collection.push(e0)
3 changes: 3 additions & 0 deletions packages/typedoc-signature/fixtures/001/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"exclude": ["test.ts"]
}
1 change: 1 addition & 0 deletions packages/typedoc-signature/fixtures/002/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function f(p0: string[]): void {}
112 changes: 112 additions & 0 deletions packages/typedoc-signature/fixtures/002/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
import {
type Entity,
DeclarationEntity,
Fragment,
} from "@onlyoffice/library-declaration/next.ts"
import {
EntityToken,
KeywordToken,
ParameterToken,
type Signature,
TextToken,
type Token,
TypeToken,
} from "@onlyoffice/signature"

export const name = "computing the signature for functions with one parameter"
export const collection: DeclarationEntity[] = []

let e0: Entity
let f0: Fragment
let s: Signature = []
let t: Token

e0 = new DeclarationEntity()
e0.id = 2

f0 = new Fragment()
f0.name = "p0"

t = new TypeToken()
t.text = "string"
s.push(t)

t = new TextToken()
t.text = "[]"
s.push(t)

f0.signature.concise.push(...s)
s = []

e0.declaration.parameters.push(f0)

t = new KeywordToken()
t.text = "function"
s.push(t)

t = new TextToken()
t.text = " "
s.push(t)

t = new EntityToken()
t.text = "f"
s.push(t)

t = new TextToken()
t.text = "("
s.push(t)

t = new ParameterToken()
t.text = "p0"
s.push(t)

t = new TextToken()
t.text = ": "
s.push(t)

t = new TypeToken()
t.text = "string"
s.push(t)

t = new TextToken()
t.text = "[]"
s.push(t)

t = new TextToken()
t.text = ")"
s.push(t)

t = new TextToken()
t.text = ": "
s.push(t)

t = new TypeToken()
t.text = "void"
s.push(t)

e0.declaration.signature.verbose.push(...s)
s = []

t = new TextToken()
t.text = "("
s.push(t)

t = new TextToken()
t.text = "p0"
s.push(t)

t = new TextToken()
t.text = ")"
s.push(t)

e0.declaration.signature.concise.push(...s)
s = []

t = new TypeToken()
t.text = "void"
s.push(t)

e0.declaration.returns.signature.concise.push(...s)
s = []

collection.push(e0)
3 changes: 3 additions & 0 deletions packages/typedoc-signature/fixtures/002/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"exclude": ["test.ts"]
}
1 change: 1 addition & 0 deletions packages/typedoc-signature/fixtures/003/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function f(p0: string, p1: number): void {}
Loading

0 comments on commit 5e5e9ab

Please sign in to comment.