Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed bug where data was referenced from global scope

Added function test for must and maximize could
Improved the printout of the ft results
  • Loading branch information...
commit 4ae8c168202b751465134634870d04a02cf550e0 1 parent d318c10
@Gianfrancoalongi authored
Showing with 21 additions and 3 deletions.
  1. +13 −1 ft.pl
  2. +8 −2 server.dyalog
View
14 ft.pl
@@ -15,7 +15,7 @@ sub send_receive_test {
}else{
$res = "passed";
}
- print "test[$_[0]]:$res\n";
+ print "$res..........[$_[0]]\n";
close($sock);
}
@@ -44,4 +44,16 @@ sub send_receive_test {
send_receive_test("book all 2 2 p4","booked slots 2 3");
send_receive_test("book all 7 1 p4","booked slots 7");
send_receive_test("book maximize 1 7 2 p1 p2 p3 p4","booked slots 4 5");
+send_receive_test("remove p1 p2 p3 p4","removed p1 p2 p3 p4");
+
+send_receive_test("add p1 p2 p3 p4","added a new calendar for p1 p2 p3 p4");
+send_receive_test("book all 1 2 p1","booked slots 1 2");
+send_receive_test("book all 6 1 p1","booked slots 6");
+send_receive_test("book all 2 1 p2","booked slots 2");
+send_receive_test("book all 6 1 p2","booked slots 6");
+send_receive_test("book all 1 3 p3","booked slots 1 2 3");
+send_receive_test("book all 5 2 p3","booked slots 5 6");
+send_receive_test("book all 3 1 p4","booked slots 3");
+send_receive_test("book mustcould 1 6 2 p1 p2 ; p3 p4","booked slots 4 5");
+
send_receive_test("stop","stopped server");
View
10 server.dyalog
@@ -105,7 +105,9 @@ calendars ← ⍬
:Case 'all'
Z book_all data
:Case 'maximize'
- Z maximize_booking
+ Z maximize_booking data
+ :Case 'mustcould'
+ Z book_musts_and_could data
:EndSelect
@@ -118,7 +120,7 @@ calendars ← ⍬
Z 'booked slots ',slots
- Z maximize_booking;from;to;duration;indices;selected;slices;slots
+ Z maximize_booking data;from;to;duration;indices;selected;slices;slots
(from to duration) data[2 3 4]
indices indices_of_named_calendars 4data
selected calendars[indices]
@@ -128,6 +130,10 @@ calendars ← ⍬
Z 'booked slots ',slots
+ Z book_musts_and_could data
+ Z 'not implemented yet'
+
+
Z indices_of_named_calendars data
Z ({ () data } ¨ calendars)/calendars
Please sign in to comment.
Something went wrong with that request. Please try again.