A LaTeX package I'm currently writing makes use of -- and definitely requires -- some of the power of LuaLaTeX. I would like to make my package's user interface -- in particular, the options that need to be loaded -- as simple as possible by making the package determine on its own which "font features" have been activated via commands such as \fontspec, \setmainfont, \defaultfontfeatures, and \addfontfeatures that are provided by the fontspec package.
The font features I'm most interested in are ligatures, in particular those called "Common" (activated by +liga), "Required" (+rlig), "Contextual" (+clig), "Historic" (+hlig), and "Discretionary"/"Rare" (+dlig).
Some functionality of the type I'm looking for is mentioned in section 25.3 of the user guide (named "Programmer's interface) of the fontspec manual. However, no specific examples are provided to demonstrate how the macros listed in this section might be used in practice. Moreover, I must confess, I'm not at all familiar with LaTeX3, the LaTeX dialect used by the fontspec package. Thus, I'm in no position to construct a user macro of this type on my own.
My question thus is: How would one write a Boolean test -- likely based on a macro that uses the interface noted in section 25.3 of the fontspec manual -- to query if, say, "historic" ligatures have been activated via one of the methods provided by the fontspec package?

\fontspec_if_feature:nTF {rawfeature}{true}{false}which could be\letto a more convenient name:\ExplSyntaxOn \cs_new_eq:NN \testforfeature \fontspec_if_feature:nTF \ExplSyntaxOff. This could then be used likefeauture hlig is \testforfeature{hlig}{active}{inactive}– cgnieder Nov 11 '12 at 14:44\fontspec_if_feature:nTF: “Test whether the currently selected font contains the raw OpenType feature#1.” So the test is apparently not for active features but for existent ones. – cgnieder Nov 12 '12 at 10:32