Skip to content

Commit a5196fa

Browse files
Update main (Add hw2)
1 parent 9aff478 commit a5196fa

25 files changed

+673
-386
lines changed

.gitignore

+400
Large diffs are not rendered by default.

FsharpProj.sln

-38
This file was deleted.

FsharpSln.sln

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31903.59
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C3F2792A-709B-4169-ADE4-3D55DC717452}"
7+
EndProject
8+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "LibHw2", "src\LibHw2\LibHw2.fsproj", "{07D1365E-068B-4B9D-999D-4F9C3B544697}"
9+
EndProject
10+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Test", "Test\Test.fsproj", "{363D4F3B-6E01-4E01-9616-7C95DFB0F5B6}"
11+
EndProject
12+
Global
13+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
14+
Debug|Any CPU = Debug|Any CPU
15+
Release|Any CPU = Release|Any CPU
16+
EndGlobalSection
17+
GlobalSection(SolutionProperties) = preSolution
18+
HideSolutionNode = FALSE
19+
EndGlobalSection
20+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
21+
{07D1365E-068B-4B9D-999D-4F9C3B544697}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
22+
{07D1365E-068B-4B9D-999D-4F9C3B544697}.Debug|Any CPU.Build.0 = Debug|Any CPU
23+
{07D1365E-068B-4B9D-999D-4F9C3B544697}.Release|Any CPU.ActiveCfg = Release|Any CPU
24+
{07D1365E-068B-4B9D-999D-4F9C3B544697}.Release|Any CPU.Build.0 = Release|Any CPU
25+
{363D4F3B-6E01-4E01-9616-7C95DFB0F5B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
26+
{363D4F3B-6E01-4E01-9616-7C95DFB0F5B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
27+
{363D4F3B-6E01-4E01-9616-7C95DFB0F5B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
28+
{363D4F3B-6E01-4E01-9616-7C95DFB0F5B6}.Release|Any CPU.Build.0 = Release|Any CPU
29+
EndGlobalSection
30+
GlobalSection(NestedProjects) = preSolution
31+
{07D1365E-068B-4B9D-999D-4F9C3B544697} = {C3F2792A-709B-4169-ADE4-3D55DC717452}
32+
EndGlobalSection
33+
EndGlobal

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This repository was created for my homeworks for the first semester of my studies at the university

tests/Program.fs Test/Program.fs

File renamed without changes.

tests/tests.fsproj Test/Test.fsproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</ItemGroup>
2222

2323
<ItemGroup>
24-
<ProjectReference Include="..\src\Lib\Lib.fsproj" />
24+
<ProjectReference Include="..\src\LibHw2\LibHw2.fsproj" />
2525
</ItemGroup>
2626

2727
</Project>

Test/Tests.fs

+140
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
namespace tests
2+
3+
open System
4+
open Microsoft.VisualStudio.TestTools.UnitTesting
5+
open LibSorting
6+
7+
[<TestClass>]
8+
type TestClass() =
9+
10+
[<TestMethod>]
11+
member this.TestMergeSort1() =
12+
let expected = [| 1; 2; 3; 4; 5; 6; 7 |]
13+
let actual = Sorts.MergeSort [| 5; 1; 6; 4; 3; 7; 2 |] compare
14+
CollectionAssert.AreEqual(expected, actual)
15+
16+
[<TestMethod>]
17+
member this.TestMergeSort2() =
18+
let expected = [| "abcd"; "abcde"; "abcdef" |]
19+
let actual = Sorts.MergeSort [| "abcde"; "abcd"; "abcdef" |] compare
20+
CollectionAssert.AreEqual(expected, actual)
21+
22+
[<TestMethod>]
23+
member this.TestMergeSort3() =
24+
let expected = [| 1; 2; 3; 4; 5; 6; 7; 8 |]
25+
let actual = Sorts.MergeSort [| 3; 4; 1; 8; 5; 2; 7; 6 |] compare
26+
CollectionAssert.AreEqual(expected, actual)
27+
28+
[<TestMethod>]
29+
member this.TestMergeSort4() =
30+
let expected = [| -12.7; -4.4; 0; 4.2; 7; 10 |]
31+
32+
let actual: float array = Sorts.MergeSort [| 0; 10; -4.4; 4.2; 7; -12.7 |] compare
33+
34+
CollectionAssert.AreEqual(expected, actual)
35+
36+
[<TestMethod>]
37+
member this.TestMergeSort5() =
38+
let expected = [| 1 |]
39+
let actual = Sorts.MergeSort [| 1 |] compare
40+
CollectionAssert.AreEqual(expected, actual)
41+
42+
[<TestMethod>]
43+
member this.TestMergeSort6() =
44+
let expected = [| "a"; "b"; "d"; "f"; "g"; "y" |]
45+
let actual = Sorts.MergeSort [| "g"; "a"; "f"; "d"; "b"; "y" |] compare
46+
CollectionAssert.AreEqual(expected, actual)
47+
48+
[<TestMethod>]
49+
member this.TestMergeSort7() =
50+
let expected = [||]
51+
let actual = Sorts.MergeSort [||] compare
52+
CollectionAssert.AreEqual(expected, actual)
53+
54+
[<TestMethod>]
55+
member this.TestBubbleSort1() =
56+
let expected = [| 1; 2; 3; 4; 5; 6; 7 |]
57+
let actual = Sorts.Bubblesort [| 5; 1; 6; 4; 3; 7; 2 |] compare
58+
CollectionAssert.AreEqual(expected, actual)
59+
60+
[<TestMethod>]
61+
member this.TestBubbleSort2() =
62+
let expected = [| "abcd"; "abcde"; "abcdef" |]
63+
let actual = Sorts.Bubblesort [| "abcde"; "abcd"; "abcdef" |] compare
64+
CollectionAssert.AreEqual(expected, actual)
65+
66+
[<TestMethod>]
67+
member this.TestBubbleSort3() =
68+
let expected = [| 1; 2; 3; 4; 5; 6; 7; 8 |]
69+
let actual = Sorts.Bubblesort [| 3; 4; 1; 8; 5; 2; 7; 6 |] compare
70+
CollectionAssert.AreEqual(expected, actual)
71+
72+
[<TestMethod>]
73+
member this.TestBubbleSort4() =
74+
let expected = [| -12.7; -4.4; 0; 4.2; 7; 10 |]
75+
76+
let actual: float array = Sorts.Bubblesort [| 0; 10; -4.4; 4.2; 7; -12.7 |] compare
77+
78+
CollectionAssert.AreEqual(expected, actual)
79+
80+
[<TestMethod>]
81+
member this.TestBubbleSort5() =
82+
let expected = [| 1 |]
83+
let actual = Sorts.Bubblesort [| 1 |] compare
84+
CollectionAssert.AreEqual(expected, actual)
85+
86+
[<TestMethod>]
87+
member this.TestBubbleSort6() =
88+
let expected = [| "a"; "b"; "d"; "f"; "g"; "y" |]
89+
let actual = Sorts.Bubblesort [| "g"; "a"; "f"; "d"; "b"; "y" |] compare
90+
CollectionAssert.AreEqual(expected, actual)
91+
92+
[<TestMethod>]
93+
member this.TestBubbleSort7() =
94+
let expected = [||]
95+
let actual = Sorts.Bubblesort [||] compare
96+
CollectionAssert.AreEqual(expected, actual)
97+
98+
[<TestMethod>]
99+
member this.TestQuickSort1() =
100+
let expected = [| 1; 2; 3; 4; 5; 6; 7 |]
101+
let actual = Sorts.QuickSort [| 5; 1; 6; 4; 3; 7; 2 |] compare
102+
CollectionAssert.AreEqual(expected, actual)
103+
104+
[<TestMethod>]
105+
member this.TestQuickSort2() =
106+
let expected = [| "abcd"; "abcde"; "abcdef" |]
107+
let actual = Sorts.QuickSort [| "abcde"; "abcd"; "abcdef" |] compare
108+
CollectionAssert.AreEqual(expected, actual)
109+
110+
[<TestMethod>]
111+
member this.TestQuickSort3() =
112+
let expected = [| 1; 2; 3; 4; 5; 6; 7; 8 |]
113+
let actual = Sorts.QuickSort [| 3; 4; 1; 8; 5; 2; 7; 6 |] compare
114+
CollectionAssert.AreEqual(expected, actual)
115+
116+
[<TestMethod>]
117+
member this.TestQuickSort4() =
118+
let expected = [| -12.7; -4.4; 0; 4.2; 7; 10 |]
119+
120+
let actual: float array = Sorts.QuickSort [| 0; 10; -4.4; 4.2; 7; -12.7 |] compare
121+
122+
CollectionAssert.AreEqual(expected, actual)
123+
124+
[<TestMethod>]
125+
member this.TestQuickSort5() =
126+
let expected = [| 1 |]
127+
let actual = Sorts.QuickSort [| 1 |] compare
128+
CollectionAssert.AreEqual(expected, actual)
129+
130+
[<TestMethod>]
131+
member this.TestQuickSort6() =
132+
let expected = [| "a"; "b"; "d"; "f"; "g"; "y" |]
133+
let actual = Sorts.QuickSort [| "g"; "a"; "f"; "d"; "b"; "y" |] compare
134+
CollectionAssert.AreEqual(expected, actual)
135+
136+
[<TestMethod>]
137+
member this.TestQuickSort7() =
138+
let expected = [||]
139+
let actual = Sorts.QuickSort [||] compare
140+
CollectionAssert.AreEqual(expected, actual)

src/Lib/Lib.fs

-30
This file was deleted.

src/Lib/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.fs

-3
This file was deleted.

src/Lib/obj/Debug/net8.0/Lib.AssemblyInfo.fs

-17
This file was deleted.

src/Lib/obj/Debug/net8.0/Lib.AssemblyInfoInputs.cache

-1
This file was deleted.
-4.12 KB
Binary file not shown.
Binary file not shown.

src/Lib/obj/Debug/net8.0/QuickSort.AssemblyInfo.fs

-17
This file was deleted.

src/Lib/obj/Debug/net8.0/QuickSort.AssemblyInfoInputs.cache

-1
This file was deleted.
-4.12 KB
Binary file not shown.
Binary file not shown.

src/Lib/obj/Lib.fsproj.nuget.dgspec.json

-65
This file was deleted.

src/Lib/obj/Lib.fsproj.nuget.g.props

-18
This file was deleted.

src/Lib/obj/Lib.fsproj.nuget.g.targets

-2
This file was deleted.

0 commit comments

Comments
 (0)