Skip to content

Commit 029b892

Browse files
committed
Fixed tests
1 parent 297e22a commit 029b892

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

TypedocConverter.Test/test.expected

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ namespace TypedocConverter.Test
149149
"A" => UnionStr.A,
150150
"B" => UnionStr.B,
151151
"C" => UnionStr.C,
152-
"Other" => UnionStr.Other,
152+
"other" => UnionStr.Other,
153153
_ => throw new System.Exception("Cannot unmarshal type UnionStr")
154154
},
155155
_ => throw new System.Exception("Cannot unmarshal type UnionStr")
@@ -163,7 +163,7 @@ namespace TypedocConverter.Test
163163
case UnionStr.A: serializer.Serialize(writer, "A"); return;
164164
case UnionStr.B: serializer.Serialize(writer, "B"); return;
165165
case UnionStr.C: serializer.Serialize(writer, "C"); return;
166-
case UnionStr.Other: serializer.Serialize(writer, "Other"); return;
166+
case UnionStr.Other: serializer.Serialize(writer, "other"); return;
167167
default: break;
168168
}
169169
throw new System.Exception("Cannot marshal type UnionStr");

TypedocConverter/EnumParser.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ let parseEnum (section: string) (node: Reflection): Entity =
4545
| _ -> ""
4646
let mutable intValue = 0L
4747
match x.DefaultValue with
48-
| Some value -> if Int64.TryParse(value, &intValue) then { Comment = comment; Name = toPascalCase x.Name; Value = Some intValue; }
48+
| Some value -> if Int64.TryParse(value, &intValue) then { Comment = comment; Name = x.Name; Value = Some intValue; }
4949
else match getEnumReferencedValue values value x.Name with
5050
| Some t -> { Comment = comment; Name = x.Name; Value = Some (int64 t); }
5151
| _ -> { Comment = comment; Name = x.Name; Value = None; }

TypedocConverter/Helpers.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ and getGenericTypeParameters (nodes: Reflection list) = // TODO: generate consta
198198
|> List.map (fun x -> x.Name)
199199
types |> List.map (fun x -> {| Type = x; Constraint = "" |})
200200
and typeSorter typeA typeB =
201-
let typesOrder = ["array"; "tuple"; "reference"; "intrinsic"]
201+
let typesOrder = ["array"; "tuple"; "reference"; "reflection"; "stringLiteral"; "intrinsic"]
202202
let indexA = typesOrder |> List.tryFindIndex (fun x -> x = typeA.Type)
203203
let indexB = typesOrder |> List.tryFindIndex (fun x -> x = typeB.Type)
204204
match (indexA, indexB) with

TypedocConverter/TypeAliasParser.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let parseUnionTypeAlias (section: string) (node: Reflection) (nodes: Type list):
1818
match x.Value with
1919
| Some value ->
2020
[{
21-
Name = toPascalCase value
21+
Name = value
2222
Comment = "///<summary>\n" + toCommentText value + "\n///</summary>"
2323
Value = None
2424
}]

0 commit comments

Comments
 (0)