guru_sdk/guru_ui/example/test/widget_test.dart

58 lines
1.7 KiB
Dart

// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:example/main.dart';
const List<int> ltSamples = [0, 1, 2, 3, 4, 5, 6, 14, 30, 60, 90, 120, 180];
int _nearestLt(int low, int high, int lt) {
if (low > high) {
return -low;
}
while (low <= high) {
final int mid = (low + high) >> 1;
if (lt == ltSamples[mid]) {
return mid;
} else if (lt < ltSamples[mid]) {
return _nearestLt(low, mid - 1, lt);
} else {
return _nearestLt(mid + 1, high, lt);
}
}
return -low;
}
int testLt(int lt) {
final idx = _nearestLt(0, ltSamples.length - 1, lt).abs().clamp(0, ltSamples.length - 1);
print("getKeywordLt: $idx lt:$lt keywordLt:${ltSamples[idx]}");
return ltSamples[idx];
}
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
// testLt(181);
print("test:${(202301 % 100)}");
print("test:${(202302 % 100)}");
print("test:${(202303 % 100)}");
print("test:${(202304 % 100)}");
print("test:${(202305 % 100)}");
print("test:${(202306 % 100)}");
print("test:${(202307 % 100)}");
print("test:${(202308 % 100)}");
print("test:${(202309 % 100)}");
print("test:${(202310 % 100)}");
print("test:${(202311 % 100)}");
print("test:${(202312 % 100)}");
});
}