Skip to content

Commit 07a8e69

Browse files
committed
test(formatter/sort_imports): Fix tests to match with original
1 parent 78c3897 commit 07a8e69

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

crates/oxc_formatter/tests/ir_transform/sort_imports.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -833,30 +833,28 @@ import { z } from "z";
833833
fn should_groups_and_sorts_by_type_and_source() {
834834
assert_format(
835835
r#"
836-
import type { T } from "t";
837-
838836
import { c1, c2, c3, c4 } from "c";
839-
import { e1 } from "e/a";
840837
import { e2 } from "e/b";
841-
import fs from "fs";
838+
import { e1 } from "e/a";
842839
import path from "path";
843840
844-
import type { I } from "~/i";
845-
846841
import { b1, b2 } from "~/b";
842+
import type { I } from "~/i";
843+
import type { D } from "./d";
844+
import fs from "fs";
847845
import { c1 } from "~/c";
848846
import { i1, i2, i3 } from "~/i";
849847
850848
import type { A } from ".";
851849
import type { F } from "../f";
852-
import type { D } from "./d";
850+
import h from "../../h";
853851
import type { H } from "./index.d.ts";
854852
855853
import a from ".";
856-
import h from "../../h";
854+
import type { T } from "t";
855+
import "./style.css";
857856
import { j } from "../j";
858857
import { K, L, M } from "../k";
859-
import "./style.css";
860858
"#,
861859
r#"{ "experimentalSortImports": {} }"#,
862860
r#"
@@ -881,32 +879,35 @@ import type { H } from "./index.d.ts";
881879
882880
import a from ".";
883881
import h from "../../h";
882+
import "./style.css";
884883
import { j } from "../j";
885884
import { K, L, M } from "../k";
886-
import "./style.css";
887885
"#,
888886
);
887+
// Input is already in the correct order, should remain unchanged
889888
assert_format(
890889
r#"
890+
import type { T } from "t";
891+
891892
import { c1, c2, c3, c4 } from "c";
892-
import { e2 } from "e/b";
893893
import { e1 } from "e/a";
894+
import { e2 } from "e/b";
895+
import fs from "fs";
894896
import path from "path";
895897
896-
import { b1, b2 } from "~/b";
897898
import type { I } from "~/i";
898-
import type { D } from "./d";
899-
import fs from "fs";
899+
900+
import { b1, b2 } from "~/b";
900901
import { c1 } from "~/c";
901902
import { i1, i2, i3 } from "~/i";
902903
903904
import type { A } from ".";
904905
import type { F } from "../f";
905-
import h from "../../h";
906+
import type { D } from "./d";
906907
import type { H } from "./index.d.ts";
907908
908909
import a from ".";
909-
import type { T } from "t";
910+
import h from "../../h";
910911
import "./style.css";
911912
import { j } from "../j";
912913
import { K, L, M } from "../k";
@@ -939,7 +940,6 @@ import { j } from "../j";
939940
import { K, L, M } from "../k";
940941
"#,
941942
);
942-
943943
// Ignore comments
944944
assert_format(
945945
r#"

0 commit comments

Comments
 (0)