Compare commits

..

4 Commits

Author SHA1 Message Date
josephgladwingeorge
e32ef86f10 new test for checking addition in between 2025-03-31 12:31:47 +05:30
josephgladwingeorge
4ece188b11 modified unit test 7 reverted changes 2025-03-31 11:00:32 +05:30
josephgladwingeorge
2c7a42fadc modified compare function 2025-03-28 19:24:25 +05:30
josephgladwingeorge
0a797a692d created a new test case for adjacent changes 2025-03-28 19:14:32 +05:30
2 changed files with 64 additions and 16 deletions

View File

@ -3,10 +3,6 @@ class InvitationStatus {
static const String pending = 'PENDING';
static const String rejected = 'REJECTED';
static const String accepted = 'ACCEPTED';
static const String completed = 'COMPLETED';
static const String failed = 'FAILED';
static const String timeout = 'TIMEOUT';
static const String expired = 'EXPIRED';
}
class CollectionNames {
@ -18,17 +14,5 @@ class CollectionNames {
static const String configurations = 'configurations';
static const String memberships = 'memberships';
static const String members = 'members';
static const String membershipPayments = 'membership_payments';
static const String clientProfiles = 'client_profiles';
static const String annualHolidays = 'annual_holidays';
static const String commonHolidays = 'common_holidays';
static const String personalTrainerAssignments =
'personal_trainer_assignments';
static const String trainerAcceptedGyms = 'trainer_accepted_gyms';
static const String dayPassEntries = 'day_pass_entries';
static const String clientInvitations = 'client_invitations';
static const String notifications = 'notifications';
static const String daypassBookings = 'day_pass_bookings';
static const String paymentOrders = 'payment_orders';
static const String membershipConfirmations = 'membership_confirmations';
}

View File

@ -1,3 +1,5 @@
import 'dart:math';
import 'package:flutter_test/flutter_test.dart';
import 'package:fitlien_common/utility.dart';
@ -86,4 +88,66 @@ void main() {
expect(deltas[1].wordDeltas[1].old!.text, "ef");
expect(deltas[1].wordDeltas[1].modified, null);
});
test('Comparison test 6', () {
var text1 = "ab bc cd ef";
var text2 = "ab bd cd ef";
var deltas = Utility.compare(text1, text2);
expect(deltas.length, 1);
expect(deltas[0].wordDeltas.length, 1);
expect(deltas[0].wordDeltas[0].old!.text, "bc");
expect(deltas[0].wordDeltas[0].modified!.text, "bd");
});
test('Comparison test 7', () {
var text1 = "abc def ghi";
var text2 = "zbc dkf gha";
var deltas = Utility.compare(text1, text2);
expect(deltas.length, 1);
expect(deltas[0].wordDeltas.length, 3);
expect(deltas[0].wordDeltas[0].old!.text, "abc");
expect(deltas[0].wordDeltas[0].modified!.text, "zbc");
expect(deltas[0].wordDeltas[1].old!.text, "def");
expect(deltas[0].wordDeltas[1].modified!.text, "dkf");
expect(deltas[0].wordDeltas[2].old!.text, "def");
expect(deltas[0].wordDeltas[2].modified!.text, "gha");
});
// test('Comparison test 8', () {
// var text1 = "ab bc cd ef";
// var text2 = "ab bd cd ef bc";
// var deltas = Utility.compare(text1, text2);
// expect(deltas.length, 2);
// expect(deltas[0].wordDeltas.length, 3);
// expect(deltas[0].wordDeltas[0].old!.text, "bc");
// expect(deltas[0].wordDeltas[0].modified!.text, "bd");
// expect(deltas[0].wordDeltas[1].old!.text, "bc");
// expect(deltas[0].wordDeltas[1].modified!.text, "cd");
// expect(deltas[0].wordDeltas[2].old!.text, "bc");
// expect(deltas[0].wordDeltas[2].modified!.text, "ef");
// expect(deltas[1].wordDeltas.length, 2);
// expect(deltas[1].wordDeltas[0].old!.text, "cd");
// expect(deltas[1].wordDeltas[0].modified!.text, null);
// expect(deltas[1].wordDeltas[1].old!.text, "ef");
// expect(deltas[1].wordDeltas[1].modified!.text, null);
// });
test('Comparison test 9', () {
var text1 = "ab bc cd ef";
var text2 = "ab bd ef bc cd";
var deltas = Utility.compare(text1, text2);
expect(deltas.length, 2);
expect(deltas[0].wordDeltas.length, 3);
expect(deltas[0].wordDeltas[0].old!.text, "bc");
expect(deltas[0].wordDeltas[0].modified!.text, "bd");
expect(deltas[0].wordDeltas[1].old!.text, "cd");
expect(deltas[0].wordDeltas[1].modified!.text, "ef");
expect(deltas[0].wordDeltas[2].old!.text, "cd");
expect(deltas[0].wordDeltas[2].modified!.text, "bc");
expect(deltas[1].wordDeltas.length, 2);
expect(deltas[1].wordDeltas[0].old!.text, "cd");
expect(deltas[1].wordDeltas[0].modified!.text, null);
expect(deltas[1].wordDeltas[1].old!.text, "ef");
expect(deltas[1].wordDeltas[1].modified!.text, null);
});
}