Closed programmingkidx closed 6 months ago
Sorry for delay, but would it be possible to get a simplified version of this test program in as an actual test for the package?
I made this patch to test my tests. To apply it "cd" to the root level of your local repo and run this command: "patch -p1 < NSError-tests.patch".
I had to comment out the Dictionary and Array tests because they cause the test system to fail. This prevents the NSError tests from running.
With all my pull requests applied all the tests run successfully.
Here is the output on my machine: go test ./macos/foundation -v === RUN TestFoundationValid --- PASS: TestFoundationValid (0.00s) === RUN TestFoundationError === RUN TestFoundationError/Empty_Map === RUN TestFoundationError/Map_with_items_in_it === RUN TestFoundationError/Check_domain_and_code_parameters --- PASS: TestFoundationError (0.00s) --- PASS: TestFoundationError/Empty_Map (0.00s) --- PASS: TestFoundationError/Map_with_items_in_it (0.00s) --- PASS: TestFoundationError/Check_domain_and_code_parameters (0.00s) PASS ok github.com/progrium/macdriver/macos/foundation 0.109s NSError-tests.patch
Why not make this patch part of this PR?
Done.
In the function type_convertion.go:convertToGoValue() it makes a call to reflect.ValueOf() for the reflect.Map case. This should not be done because the value that ToGoMap() returns is already of type reflect.Value. Also it makes type assertions fail for map types.
This program was used to test these two patches:
Before these patches this program would panic at the call to myError.UserInfo(). With the patches applied this program works correctly.