slothdude,
@slothdude@mastodon.online avatar

I ran into a weird issue today. I am organising our codebase to use local packages for various things. I have an error enum defined in a local package. There is a class in the main application target that throws the error. But when I try to check that the error is correctly thrown in a unit test, the catch doesn’t capture it. Trying to print the type and value with the help of type(of:) does give the correct looking result. I even tried with the full type including the module name.

luckkerr,
@luckkerr@mastodon.world avatar

@slothdude I had the same issue. In my case the problem was due to that package being added as linked library both to main target and unit test target. Keeping it only for main target fixed it.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • swift
  • DreamBathrooms
  • mdbf
  • osvaldo12
  • magazineikmin
  • GTA5RPClips
  • rosin
  • thenastyranch
  • Youngstown
  • cubers
  • slotface
  • khanakhh
  • kavyap
  • InstantRegret
  • Durango
  • JUstTest
  • everett
  • ethstaker
  • cisconetworking
  • provamag3
  • Leos
  • modclub
  • ngwrru68w68
  • tacticalgear
  • tester
  • megavids
  • normalnudes
  • anitta
  • lostlight
  • All magazines