Skip to content

Commit 68064ae

Browse files
committed
chore: update Runner.xcscheme to include custom LLDB init file and refactor app tests
- Added customLLDBInitFile to Runner.xcscheme for improved debugging. - Refactored app_test.dart to streamline sponsored posts testing and removed redundant sequential test. - Deleted obsolete test_sponsored_posts_alg.dart file to clean up the test suite.
1 parent 6260dee commit 68064ae

3 files changed

Lines changed: 5 additions & 124 deletions

File tree

ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<MacroExpansion>
3132
<BuildableReference
@@ -43,6 +44,7 @@
4344
buildConfiguration = "Debug"
4445
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4546
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
4648
launchStyle = "0"
4749
useCustomWorkingDirectory = "NO"
4850
ignoresPersistentStateOnLaunch = "NO"

test/app/view/app_test.dart

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,11 @@ import 'package:flutter_test/flutter_test.dart';
55

66
void main() {
77
group('Test sponsored posts algorithm', () {
8-
final posts = <int>[1, 3, 4, 3, 2, 3, 4, 5, 6, 1]; // Your fetched posts
9-
const numSponsoredPosts = 3; // Number of sponsored posts to insert
10-
11-
test('sequentially with greedy algorithm', () {
12-
final effectiveIndexes = calculateEffectiveIndexesSequentially(
13-
posts.length,
14-
numSponsoredPosts,
15-
);
16-
17-
// Insert sponsored posts at the calculated effective indexes
18-
for (final index in effectiveIndexes) {
19-
posts.insert(
20-
index + 1,
21-
50,
22-
); // Adjust the index as needed based on your list structure
23-
}
24-
25-
if (kDebugMode) {
26-
print(posts);
27-
}
28-
expect(true, true);
29-
});
30-
318
group('randomly', () {
329
test('10 posts', () {
3310
final posts = [4, 2, 3, 4, 1, 2, 3, 4, 2, 5];
11+
const numSponsoredPosts = 3; // Number of sponsored posts to insert
12+
3413
final effectiveIndexes = calculateEffectiveIndexesRandomly(
3514
posts.length,
3615
numSponsoredPosts,
@@ -47,6 +26,7 @@ void main() {
4726
if (kDebugMode) {
4827
print(posts);
4928
}
29+
expect(effectiveIndexes.length, numSponsoredPosts);
5030
});
5131
});
5232
});

test/sponsored_posts/test_sponsored_posts_alg.dart

Lines changed: 0 additions & 101 deletions
This file was deleted.

0 commit comments

Comments
 (0)