Using reflection to change static final File.separatorChar for unit testing?

前端 未结 7 906
太阳男子
太阳男子 2020-11-28 09:37

Specifically, I\'m trying to create a unit test for a method which requires uses File.separatorChar to build paths on windows and unix. The code must run on bot

7条回答
  •  庸人自扰
    2020-11-28 10:01

    Just use / everywhere when constructing Files. I've been doing that for 13 years and never had a problem. Nothing to test either.

提交回复
热议问题