Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
image: Visual Studio 2017
image: Visual Studio 2019

init:
- git config --global core.autocrlf true

environment:
matrix:
- solution: Semester4/PointFree/PointFree.sln

before_build:
- nuget restore semester2/6.1/HW6T2.sln
- nuget restore %solution%

build:
project: semester2/2.3/2.3.sln
project: $(solution)

test_script:
- dotnet test %solution%
22 changes: 22 additions & 0 deletions semester4/PointFree/PointFree.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "PointFree", "PointFree\PointFree.fsproj", "{6F6E5CF2-7DB2-4763-88F7-0F7308AB488F}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "PointFreeTests", "PointFreeTests\PointFreeTests.fsproj", "{98C11D07-A7FA-42DC-B8D9-196DAA909B55}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6F6E5CF2-7DB2-4763-88F7-0F7308AB488F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6F6E5CF2-7DB2-4763-88F7-0F7308AB488F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6F6E5CF2-7DB2-4763-88F7-0F7308AB488F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6F6E5CF2-7DB2-4763-88F7-0F7308AB488F}.Release|Any CPU.Build.0 = Release|Any CPU
{98C11D07-A7FA-42DC-B8D9-196DAA909B55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{98C11D07-A7FA-42DC-B8D9-196DAA909B55}.Debug|Any CPU.Build.0 = Debug|Any CPU
{98C11D07-A7FA-42DC-B8D9-196DAA909B55}.Release|Any CPU.ActiveCfg = Release|Any CPU
{98C11D07-A7FA-42DC-B8D9-196DAA909B55}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
12 changes: 12 additions & 0 deletions semester4/PointFree/PointFree/PointFree.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module PointFree

///Takes list and number and multiplies every element of list to a number
let mapMultiply x l = List.map (fun y -> y * x) l

let mapMultiply1 (x: int): int list -> int list = List.map (fun y -> y * x)

let mapMultiply2 (x: int): int list -> int list = List.map (fun y -> (*) x y)

let mapMultiply3 (x: int): int list -> int list = x |> (*) |> List.map

let mapMultiply4: int -> int list -> int list = List.map << (*)
11 changes: 11 additions & 0 deletions semester4/PointFree/PointFree/PointFree.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="PointFree.fs" />
</ItemGroup>

</Project>
22 changes: 22 additions & 0 deletions semester4/PointFree/PointFreeTests/PointFreeTest.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module TestProject1

open NUnit.Framework
open FsCheck
open PointFree

let ``example and first are equal`` number list = mapMultiply number list = mapMultiply1 number list
let ``first and second are equal`` number list = mapMultiply1 number list = mapMultiply2 number list
let ``second and third are equal`` number list = mapMultiply2 number list = mapMultiply3 number list
let ``third and fourth are equal`` number list = mapMultiply3 number list = mapMultiply4 number list

[<Test>]
let test1 () = Check.QuickThrowOnFailure ``example and first are equal``

[<Test>]
let test2 () = Check.QuickThrowOnFailure ``first and second are equal``

[<Test>]
let test3 () = Check.QuickThrowOnFailure ``second and third are equal``

[<Test>]
let test4 () = Check.QuickThrowOnFailure ``third and fourth are equal``
27 changes: 27 additions & 0 deletions semester4/PointFree/PointFreeTests/PointFreeTests.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>

<IsPackable>false</IsPackable>
<GenerateProgramFile>false</GenerateProgramFile>
<RootNamespace>TestProject1</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FsCheck" Version="3.0.0-alpha4" />
<PackageReference Include="nunit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
</ItemGroup>

<ItemGroup>
<Compile Include="PointFreeTest.fs" />
<Compile Include="Program.fs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\PointFree\PointFree.fsproj" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions semester4/PointFree/PointFreeTests/Program.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module Program = let [<EntryPoint>] main _ = 0