Skip to content

Commit

Permalink
feat(asset-bundle): fix GenerateAllABAPI->generateAllABs: not check c…
Browse files Browse the repository at this point in the history
…ircle dependency

because has bug and it's not easy to fix...
  • Loading branch information
yyc-git committed Apr 25, 2019
1 parent 0e300f6 commit 596703a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
12 changes: 5 additions & 7 deletions src/asset_bundle/all/generate/GenerateAllABSystem.re
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ open WonderBsMost;
/* open DependencyDataType; */

/* TODO need test */
let rec _isCircleDependency =
/* let rec _isCircleDependency =
(
dependencyRelation,
recordedAbPathArr,
Expand Down Expand Up @@ -73,7 +73,7 @@ let _checkCircleDependency = dependencyRelation =>
~params={j||j},
),
) :
();
(); */

/* let _checkSABDependencyRelation = () => {
Expand All @@ -91,9 +91,8 @@ let buildDependencyRelation = dependencyRelationArrArr =>
WonderCommonlib.ImmutableHashMapService.createEmpty(),
);

let generate = (dependencyRelation, (sabDataArr, rabDataArr)) => {
_checkCircleDependency(dependencyRelation);

let generate = (dependencyRelation, (sabDataArr, rabDataArr)) =>
/* _checkCircleDependency(dependencyRelation); */
RemoveDependencyDataSystem.removeDuplicateBufferData(
dependencyRelation,
FindDependencyDataSystem.buildImageAndGeometryNameMap(rabDataArr),
Expand All @@ -106,5 +105,4 @@ let generate = (dependencyRelation, (sabDataArr, rabDataArr)) => {
newRabDataArr,
newSabDataArr,
)
);
};
);
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let _ =
});
afterEach(() => restoreSandbox(refJsObjToSandbox(sandbox^)));

describe("check dependency relation", () => {
/* describe("check dependency relation", () => {
describe("if has circle dependency, fatal", () => {
testPromise("test1", () =>
expect(() =>
Expand Down Expand Up @@ -68,7 +68,7 @@ let _ =
);
});
describe("else, not fatal", () =>
describe("else, not fatal", () => {
testPromise("test1", () =>
expect(() =>
GenerateAllABSystem.generate(
Expand All @@ -82,9 +82,24 @@ let _ =
|> not_
|> toThrow
|> resolve
)
);
});
);
testPromise("test2", () =>
expect(() =>
GenerateAllABSystem.generate(
GenerateAllABTool.buildDependencyRelation([|
[|"s1.sab", "r1.rab", "r2.rab"|],
[|"r1.rab", "r3.rab"|],
[|"r2.rab", "r3.rab"|],
|]),
([||], [||]),
)
)
|> not_
|> toThrow
|> resolve
);
});
}); */

describe("remove duplicate buffer data", () => {
describe("remove duplicate buffer data from rab", () => {
Expand Down

0 comments on commit 596703a

Please sign in to comment.