Skip to content

Commit

Permalink
Upgrade NUglify 1.6.6 and add SupportDoubleAsteriskOperator() test ca…
Browse files Browse the repository at this point in the history
…se. (#509)

* Upgrade NUglify 1.6.4 and add SupportNewSyntax() test case.

* Upgrade NUglify 1.6.5 and add SupportDoubleAsteriskOperator() test case.

* Upgrade NUglify 1.6.6

Co-authored-by: johnny <johnny@wantgoo.com>
  • Loading branch information
supershowwei and johnny-wantgoo committed Aug 25, 2020
1 parent 8b1de34 commit 94f00b4
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/BundlerMinifier.Core/BundlerMinifier.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NUglify" Version="1.6.4" />
<PackageReference Include="NUglify" Version="1.6.6" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/BundlerMinifier/BundlerMinifier.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<PackageReference Include="Microsoft.Build.Framework" Version="15.1.0-*" PrivateAssets="All" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.1.0-*" PrivateAssets="All" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" PrivateAssets="All" />
<PackageReference Include="NUglify" Version="1.6.4" PrivateAssets="All" />
<PackageReference Include="NUglify" Version="1.6.6" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
Expand Down
4 changes: 4 additions & 0 deletions src/BundlerMinifierTest/BundlerMinifierTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
<Content Include="artifacts\*.html" />
</ItemGroup>

<ItemGroup>
<None Remove="artifacts\file5.js" />
</ItemGroup>

<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
Expand Down
10 changes: 10 additions & 0 deletions src/BundlerMinifierTest/BundlerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,15 @@ public void SupportNewSyntax()

Assert.AreEqual("function test(n){for(const t of n)console.log(t)}test([1,2,3,4]);", jsResult);
}

[TestMethod]
public void SupportDoubleAsteriskOperator()
{
_processor.Process(TEST_BUNDLE.Replace("test1", "test9"));

string jsResult = File.ReadAllText("../../../artifacts/test9.min.js");

Assert.AreEqual("function r(n,t){return n**t}let x=2**5.1,y=3**x,z=2**81,p=21;", jsResult);
}
}
}
9 changes: 9 additions & 0 deletions src/BundlerMinifierTest/artifacts/file5.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
let x = 2 ** 5.1;
let y = 3 ** x;
let z = 2 ** 3 ** 4;

let p = 5 + 2 ** 4;

function r(a, b) {
return a ** b;
}
8 changes: 8 additions & 0 deletions src/BundlerMinifierTest/artifacts/test9.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
{
"outputFileName": "test9.min.js",
"inputFiles": [
"file5.js"
]
}
]
1 change: 1 addition & 0 deletions src/BundlerMinifierTest/artifacts/test9.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function r(n,t){return n**t}let x=2**5.1,y=3**x,z=2**81,p=21;
4 changes: 2 additions & 2 deletions src/BundlerMinifierVsix/BundlerMinifierVsix.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@
<HintPath>..\..\packages\NuGet.VisualStudio.3.5.0\lib\net45\NuGet.VisualStudio.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="NUglify, Version=1.6.4.0, Culture=neutral, PublicKeyToken=15bc7810aec21b5e, processorArchitecture=MSIL">
<HintPath>..\..\packages\NUglify.1.6.4\lib\net40\NUglify.dll</HintPath>
<Reference Include="NUglify, Version=1.6.6.0, Culture=neutral, PublicKeyToken=15bc7810aec21b5e, processorArchitecture=MSIL">
<HintPath>..\..\packages\NUglify.1.6.6\lib\net40\NUglify.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
Expand Down
2 changes: 1 addition & 1 deletion src/BundlerMinifierVsix/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<packages>
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net46" />
<package id="NuGet.VisualStudio" version="3.5.0" targetFramework="net46" />
<package id="NUglify" version="1.6.4" targetFramework="net46" />
<package id="NUglify" version="1.6.6" targetFramework="net46" />
</packages>

0 comments on commit 94f00b4

Please sign in to comment.