I have this test that does fail when run. I am not sure why though since the a should be true. Can somebody explain me why?
test('test error', () async {
const error = Exception;
const a = error is Exception;
expect(a, true);
});
I have this test that does fail when run. I am not sure why though since the a should be true. Can somebody explain me why?
test('test error', () async {
const error = Exception;
const a = error is Exception;
expect(a, true);
});
Copyright © 2021 Jogjafile Inc.
erroris not an instance of anException.erroris theExceptiontype, andx is Tchecks ifxis an instance ofT. Therefore:Exception() is Exceptionwould be true.error is Exception(equivalent toException is Exception) would be false.error is Type(equivalent toException is Exception) would be true.error == Exception(equivalent toException == Exception) would be true.